How to do a "command" service

John Buttery johnb+argus at academicsuperstore.com
Wed Aug 15 17:22:23 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"?

-- 
John Buttery <johnb at academicsuperstore.com>
System Administrator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.tcp4me.com/pipermail/arguslist/attachments/20070815/8bbac8bb/attachment.bin


More information about the Arguslist mailing list