How to do a "command" service

Jeff Weisberg jaw+arguslist at tcp4me.com
Wed Aug 29 21:26:20 EDT 2007


|   I was wondering if anybody could elaborate on the ability of Argus to 
| alert based on the exitstatus of a command.  I have this block:
| 
| Service Prog {
|   ## Monitor MySQL replication slave
|   label: repslave
|   info: MySQL replication slave
|   uname: repslave
|   command: /usr/local/bin/checkslave -m 0 db_machine
|   ## Can use expect, but the script already exits nonzero
|   ## if the slave is too far behind or down, so let's
|   ## just use that and keep it simple
|   ## OK, maybe not, looks like exitstatus doesn't work
|   expect: ^SC is 0$
| }
| 
|   This config works, but I thought it'd be a little simpler to just act 
| on the exitstatus.  Unfortunately, it's not working the way I expected.  
| If I comment out the "expect" line, the service never 
| goes "down"...even when I forcibly make the script exit "1".
|   What's the correct syntax for a block that basically says "run this 
| command, and alert if the exitstatus is nonzero"?


you are correct. if you remove the 'expect', it will act based
on the exit status.


you can click on the 'debugging' page, and look at 'prog::exit'
for the actual value that the program exited with to confirm





More information about the Arguslist mailing list