I create a hand made plugin to monitoring an HA service that is running in my linux environment, basically if I execute the plugin in the linux servers works fine but when I upload it to OpsView libexec directory and then I configure it from the console to monitor a linux server it assume always the following output: WARNING. I think the problem is related that OpsView server runs the script locally and evaluate the status of the service,
I have tried to use parameters like -H %HOSTADDRESS% but still not working, I will appreciate any help cause I'm completly newbie on this.
Thanks in advance.
### BEGIN OPSVIEW INFO
# Macros: HOSTNAME,SERVICEDESC ### END OPSVIEW INFO OK=0 WARNING=1 CRITICAL=2 status=`/etc/init.d/heartbeat status` if echo "$status" | grep -q running; then echo "Service HA is running" exit $OK elif echo "$status" | grep -a stopped; then echo "Service HA is stopped" exit $CRITICAL else echo "Service HA could not be find" exit $WARNING fi