monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: icmp failure, but no exec?


From: Mike Jackson
Subject: Re: icmp failure, but no exec?
Date: Mon, 10 Apr 2006 09:03:59 -0700

After 5 unsuccessful pings cycles, it did nothing. It never exec'ed the listed command, nor did it give any indication why it didn't - no errors or anything. Help?

I think the problem may be with the exec command. You cannot use a shell script syntax here. If you want to write a shell-script you must start a shell and pass it the commands, like so:

exec "/bin/bash -c '/usr/local/bin/monit unmonitor bigbrother-client;
/usr/local/bin/monit unmonitor bigbrother-server;
/usr/local/etc/rc.d/bigbrother.sh stop'" [1]

The reason nothing apparently happened was that the exec command only succeeded in unmonitoring since it takes the first part as the command and the rest as arguments to the command. (See man execv)

Thanks, wrapping it in a shell call worked. But, that raises another issue: It would be helpful if monit recorded exec'ing commands in the syslog.

[1] Stuff like this would be much easier to write if we can call other service's action. That is, refer to other services in the control file.

Yes, that would be very useful!

This arose because Big Brother runs from our office, which is on a cable modem connection. The power supply for the cable modem fell out of the wall one night, and BB generated over 4000 outgoing messages letting us know it couldn't connect to the outside world. When someone got into the office in the morning, they plugged in the modem, and my cell phone started going crazy with pages, since sendmail could now send them. I knew monit would be the ideal solution since it could disable monitorning the outside world if it couldn't ping out.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]