Writing a custom sensor - how to mark feedback as error
Posted: Wed Jan 09, 2013 5:31 am
Hi all,
i'm writing a custom sensor , it does a curl query and reports feedback as result. There are two possible feedbacks, one is similar to "{:status 0, :desc "Alive: 29741}" and it means service is ok, and reports it's PID, other is similar to "{:status 0, :desc "Started: 2012-08-30-10:13"}," and it's a error - it reports service was last seen alive at mentioned date.
How can i get a green/red indicator in nagios for mentioned sensor feedbacks ? Desired behavior is 'ALL GREEN' while sensor reports 'Alive' , and 'RED/CRIT' for anything else.
Sensor works like this:
ServerA monitors ServerB via NRPE. On serverB there is a custom NRPE sensor that runs a bash script that has a curl query in it.
ServerA runs Nagios Core on Debian linux, ServerB runs NRPE on CentOS 6.x linux.
Thank you in advance.
i'm writing a custom sensor , it does a curl query and reports feedback as result. There are two possible feedbacks, one is similar to "{:status 0, :desc "Alive: 29741}" and it means service is ok, and reports it's PID, other is similar to "{:status 0, :desc "Started: 2012-08-30-10:13"}," and it's a error - it reports service was last seen alive at mentioned date.
How can i get a green/red indicator in nagios for mentioned sensor feedbacks ? Desired behavior is 'ALL GREEN' while sensor reports 'Alive' , and 'RED/CRIT' for anything else.
Sensor works like this:
ServerA monitors ServerB via NRPE. On serverB there is a custom NRPE sensor that runs a bash script that has a curl query in it.
ServerA runs Nagios Core on Debian linux, ServerB runs NRPE on CentOS 6.x linux.
Thank you in advance.