Monit monitor http status with 404 page

Since version 5.8, Monit has the status option: STATUS option can be used to explicitly test the HTTP status code returned by the HTTP server. If not used, the http protocol test will fail if the status code returned is greater than or equal to 400. You can override this behaviour by using the status … Read more

Disable Monit alerts when PID changed

You can disable this alert by setting up a local alert statement. This is thoroughly documented here: http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement This should do it: check process blop with pidfile /…/blop.pid alert recipient@address.com but not on { pid } start program = “…” stop program = “…”

How to find the .pid file for a given process

You’ll usually find the PID files for daemonized processes in /var/run/ on Redhat/CentOS-style systems. Short of that, you can always look in the process init script. For instance, the SSH daemon is started with the script in /etc/init.d/sshd. Sometimes the PID will be defined there (search for pid, PID, PIDFILE, PID_FILE, etc.). However, most other … Read more

Monit versus Nagios

Yes. Nagios has support for custom scripts and checks, better integration and more granular notification options. Monit is good for basic system checks and daemons monitoring. Nagios is more flexible, but is also more involved to install. I find that Monit is good for single-host installations, but multi-Monit (M/Monit) really isn’t that good of a … Read more

Sending a test/example alert from monit?

I usually restart a trivial service (like ntp) that I’m monitoring in order to test the alerts. I did find this suggestion in the mailing list archives… It’s a way to leverage the alert reminder functionality in Monit to ensure that the alert path is functioning properly. Basically, a periodic reminder. Tune the cycle to … Read more

monit: check process without pidfile

In monit, you can use a matching string for processes that do not have a PID. Using the example of a process named “myprocessname”, check process myprocessname matching “myprocessname” start program = “/etc/init.d/myproccessname start” stop program = “/usr/bin/killall myprocessname” if cpu usage > 95% for 10 cycles then restart Maybe if you check to see … Read more