Subject: Service Prog

From: Scott Hiemstra <[email-masked]>
Date: Thu, 19 Jan 2012 14:09:07 -0500

This may be an undocumented feature, figured I would ask before attempting it.  The docs for "Service Prog" state that expect is required but I would like it to evaluate the value of an integer against a known threshold.  I know I could run it through SNMP and then use maxvalue on the OID but prog seems like it fits the bill a little more.  Is it possible to have a program check use maxvalue instead of expect?  If there is another way to do this such as a fancy regex, I welcome that as well.

I'm running Argus: dev-20111102.

I would like to do something like this:
Service Prog {
	command:	bash /usr/local/bin/my_script_that_returns_an_int.sh
	maxvalue:	5
}

Thanks in advance,
Scott

---

From: Jeremy Kister <[email-masked]>
Date: Thu, 19 Jan 2012 15:31:15 -0500

> 	command:	bash /usr/local/bin/my_script_that_returns_an_int.sh

That'd work just fine.  but you should also be careful that some 
unexpected output is not evaluated to 5.  in shell it'd be much less 
common, but when I was running perl code, I broke one of the modules the 
script was using and perl was returning some error about it, but didnt 
trip the value test.

so something more appropriate might be:
Service Prog {
  command:   bash /usr/local/bin/my_script_that_returns_an_int.sh
  maxvalue:  5
  nexpect:   [a-zA-Z]
}

---

From: Scott Hiemstra <[email-masked]>
Date: Thu, 19 Jan 2012 16:05:40 -0500

Works like a champ, thanks man.

Scott

-----Original Message-----
From: [email-masked] [mailto:[email-masked]] On Behalf Of Jeremy Kister
Sent: Thursday, January 19, 2012 3:31 PM
To: Discussion about Argus
Subject: Re: Service Prog

> 	command:	bash /usr/local/bin/my_script_that_returns_an_int.sh

That'd work just fine.  but you should also be careful that some unexpected output is not evaluated to 5.  in shell it'd be much less common, but when I was running perl code, I broke one of the modules the script was using and perl was returning some error about it, but didnt trip the value test.

so something more appropriate might be:
Service Prog {
  command:   bash /usr/local/bin/my_script_that_returns_an_int.sh
  maxvalue:  5
  nexpect:   [a-zA-Z]
}
_______________________________________________
http://argus.tcp4me.com/
[email-masked]
http://www.tcp4me.com/mailman/listinfo/arguslist