Re: pmie ruleset question

"Mark Goodwin" <[email protected]>
Newsgroups gmane.comp.sysutils.pcp
Message-ID <[email protected]>
On Wed, Nov 2, 2016 at 4:05 PM, Chandana De Silva <[email protected]>
wrote:

> This does not
>
> $ cat test0.pmie
> delta = 1 min;
>
> ruleset
> ( count_inst( match_inst "/usr/bin/somebinary" proc.psinfo.pid:'local:' > 0) == 1)
>     -> print "OK, %v somebinary processess\n"
>
> ( count_inst( match_inst "/usr/bin/somebinary" proc.psinfo.pid:'local:' > 0) == 0)
>     -> print "NOT OK, %v somebinary processess\n"
>
> otherwise
>     -> print "NOT OK, %v somebinary processess\n"
> ;
>
>
Hi Chandana, I think you need an 'else' before the second rule, e.g.

ruleset
( count_inst( match_inst "/usr/bin/somebinary" proc.psinfo.pid:'local:' >
0) == 1)
    -> print "OK, %v somebinary processess\n"

else ( count_inst( match_inst "/usr/bin/somebinary"
proc.psinfo.pid:'local:' > 0) == 0)
    -> print "NOT OK, %v somebinary processess\n"

otherwise
    -> print "NOT OK, %v somebinary processess\n"
;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.