Page 1 of 1

Graph a Monitored Service

Posted: Thu Feb 16, 2012 8:53 am
by lamin
Hello guys,
I am wondering if there is a way to graph a windows service (sql service, iis). The services i am watched only say "started" and when i go the performance graph nothing show up.

Re: Graph a Monitored Service

Posted: Thu Feb 16, 2012 10:03 am
by scottwilkerson
lamin wrote:Hello guys,
I am wondering if there is a way to graph a windows service (sql service, iis). The services i am watched only say "started" and when i go the performance graph nothing show up.
This depends on what the plugin returns. Some return performance data and some do not.

http://nagiosplug.sourceforge.net/devel ... lines.html

Re: Graph a Monitored Service

Posted: Thu Feb 16, 2012 11:02 am
by lamin
Attached is the plugin that i am using and i believe it is check_nt. So my question is it is doable?

Re: Graph a Monitored Service

Posted: Thu Feb 16, 2012 11:51 am
by scottwilkerson
As I suspected. SERVICESTATE doesn't return performance data.

It would be possible, but you would have to write some kind of wrapper plugin

Re: Graph a Monitored Service

Posted: Thu Feb 16, 2012 12:04 pm
by lamin
So how can i get that done?

Re: Graph a Monitored Service

Posted: Thu Feb 16, 2012 2:24 pm
by scottwilkerson
Writing custom wrapper plugins really isn't what the Nagios XI support is for, however it would look something like this

Code: Select all

#!/bin/bash
LINE=`/usr/local/nagios/libexec/check_nt $*`
RC=$?
echo $LINE \| state=$RC
exit $RC
name it something unique like check_nt_wrapper upload the plugin ( Admin -> Manage Plugins )
add a new command to Configure -> Core Config Manager -> Commands like this

Code: Select all

Command*    check_nt_wrapper
Command line*   $USER1$/check_nt_wrapper -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$
Then change the service command from
check_xi_service_nsclient
to
check_nt_wrapper

Re: Graph a Monitored Service

Posted: Fri Feb 17, 2012 7:49 am
by lamin
Thanks for the assistance but can you please be more specific with the code because i really don't get it.

Thanks

Re: Graph a Monitored Service

Posted: Fri Feb 17, 2012 4:18 pm
by scottwilkerson
Feel free to contact [email protected] if you would like a quote on custom wrapper plugin.