0
votes

I am monitoring a java daemon process with PID. Below is the code.

  check process SemanticReplication with pidfile "/ngs/app/edwt/opsmonit  /monit/scripts/process.pid"
    start = "/ngs/app/edwt/scripts/javadaemon/start_daemon.ksh"
    stop = "/ngs/app/edwt/scripts/javadaemon/stop_daemon.ksh"

Many times, even though java daemon process is up and running, I get false alert as process not running. In the next monit check cycle (after a minute), another monit alert triggers as process is up and running.

Can someone help how do we avoid this false alerts ?

1
Is the pidfile path correct? Its pretty weird with those blank spaces. Is that all the code you use for monitoring that service? - Eduardo López

1 Answers

0
votes

Your check statement is to have monit check for the existence of the pid file (which looks weird with the spaces, btw). If there isn't any, it'll send an alert by default and then runs the start directive.

I get around this by having a check process ... matching statement like so:

check process app-pass matching 'Passenger RubyApp: \/home\/app\/app-name\/public'

Essentially, "matching" does the equivalent of ps aux | grep ... which does a better job when I can't rely on a pid file existing, like with a child process.