This page last changed on Jun 18, 2013 by jmspooner.

Hi,

Was thinking, rather than just parsing the output of the shell command that was executed, could we not have the option of doing something with the exit state? IE if you use ping and the remote host responds then ping exits with 0.

It would make sense. Would need to be added. Can you compile Java?

Posted by juha at Jun 18, 2013 10:57

I'm sorry, I have experience of PHP and Bash, some perl and C++ but I'm very much new to java. However OR was all the excuse I needed to start getting into it so that should improve in time.

In the mean time I've used the work around as follows: (I'm sure you know but for others reading) example below

Name: jon-desktop
Command: shell execution protocol
Path: /bin/ping
Command parameter: 192.168.1.152 -n -c 1 -w 1
Polling interval: 1m
RegularExpression: (1|0)\sreceived
Sensor names: jon-desktopState

From there on I use a custom sensor mapping 1 = on and 0 = off

Its working rather well thus far. However if at some point we could choose to use the exit state then the ping command could be a little more ideal such as "192.168.1.152 -n -c 3 -w 3" IE a few more pings just to make sure.

Cheers

Posted by jmspooner at Jun 18, 2013 11:42
Document generated by Confluence on Jun 05, 2016 09:40