From shiemstra at h2.com Thu Jan 19 14:09:07 2012 From: shiemstra at h2.com (Scott Hiemstra) Date: Thu, 19 Jan 2012 14:09:07 -0500 Subject: Service Prog Message-ID: <073C6B4DF1DDC8498449BE3F9575666D02E135CF8788@horus.h2.com> 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 argus-02 at jeremykister.com Thu Jan 19 15:31:15 2012 From: argus-02 at jeremykister.com (Jeremy Kister) Date: Thu, 19 Jan 2012 15:31:15 -0500 Subject: Service Prog In-Reply-To: <073C6B4DF1DDC8498449BE3F9575666D02E135CF8788@horus.h2.com> References: <073C6B4DF1DDC8498449BE3F9575666D02E135CF8788@horus.h2.com> Message-ID: <4F187D93.2000907@jeremykister.com> On 1/19/2012 2:09 PM, Scott Hiemstra wrote: > I would like to do something like this: > Service Prog { > command: bash /usr/local/bin/my_script_that_returns_an_int.sh > maxvalue: 5 > } 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 shiemstra at h2.com Thu Jan 19 16:05:40 2012 From: shiemstra at h2.com (Scott Hiemstra) Date: Thu, 19 Jan 2012 16:05:40 -0500 Subject: Service Prog In-Reply-To: <4F187D93.2000907@jeremykister.com> References: <073C6B4DF1DDC8498449BE3F9575666D02E135CF8788@horus.h2.com> <4F187D93.2000907@jeremykister.com> Message-ID: <073C6B4DF1DDC8498449BE3F9575666D02E135CF878C@horus.h2.com> Works like a champ, thanks man. Scott -----Original Message----- From: arguslist-bounces at tcp4me.com [mailto:arguslist-bounces at tcp4me.com] On Behalf Of Jeremy Kister Sent: Thursday, January 19, 2012 3:31 PM To: Discussion about Argus Subject: Re: Service Prog On 1/19/2012 2:09 PM, Scott Hiemstra wrote: > I would like to do something like this: > Service Prog { > command: bash /usr/local/bin/my_script_that_returns_an_int.sh > maxvalue: 5 > } 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/ Arguslist at tcp4me.com http://www.tcp4me.com/mailman/listinfo/arguslist