In this post, just a link of files contains help guide ([command] –help) for the most common unix shell commands.
“monit is a utility for managing and monitoring processes, files, directories and devices on a Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. E.g. monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses to much resources. You may use monit to monitor files, directories and devices for changes, such as timestamps changes, checksum changes or size changes.
Monit is controlled via an easy to configure control file based on a free-format, token-oriented syntax. Monit logs to syslog or to its own log file and notifies you about error conditions via customizable alert messages. Monit can perform various TCP/IP network checks, protocol checks and can utilize SSL for such checks. Monit provides a http(s) interface and you may use a browser to access the monit program.”[ref] .
How to install in ubuntu 8.10
- sudo apt-get install monit
- edit /etc/monit/monitrc and remove comments
#launch system mon every 2min
set daemon 120
#set web interface on port 2812
set httpd port 2812 and
# allow localhost and request from IP 18.104.22.168
#request username (admin) and password(monit)
check process apache with pidfile /usr/local/apache/logs/httpd.pid
#check mysql service (other server)
check host myserver with address 192.168.1.1
if failed icmp type echo count 3 with timeout 3 seconds then alert
if failed port 3306 protocol mysql with timeout 15 seconds then alert
#set alerts via email
set mailserver mail.domain.com
set alert email@example.com
- check the syntax of the previous file with
sudo monit -t
- edit /etc/default/monit
- start deamon !!
sudo /etc/init.d/monit start
- call web interface
use admin and password specified before
In this post I’ll present my PHP class to show differences (file missing or different file date) between files in two directories (recursively).
It’s useful to compare two websites (Example, test and live versioning the same server) and show the differences, much faster than a FTP synchronization, and customizable (size differences instead of time, PHP copy commands with backup etc…).
How to use:
View the code