Page 1 of 1

Help with adding custom service

Posted: Wed Dec 12, 2012 9:02 pm
by cvt1971
Hello All,

We have Nagios Core 3.4.1 monitoring 30 servers, 10 switches. Servers being monitored are CPU/HD/Ping. Nagios is running on a Red Hat Enterprise 6 ...Everything is running awesome and we are monitoring everything via web interface. We can see if a server or switch goes down, but would like to monitor something that is not on a template

Task: We have custom developers and they have created a program that is running as a service. The Server is named "LinuxServer1" and the service is called "CrazyService" located in /etc/init.d
We would like to monitor when "CrazyService" has stopped running... please help!

Server: LinuxServer1
Service to monitor: CrazyService
Location of service: /etc/init.d

Thank you !

CVT

Re: Help with adding custom service

Posted: Thu Dec 13, 2012 10:04 am
by ScareCrow57
If you are using nrpe then simply create a command: check_procs -c 1:10 -C CrazyService

Re: Help with adding custom service

Posted: Fri Dec 14, 2012 12:17 pm
by slansing
That, as well as this:

http://assets.nagios.com/downloads/nagi ... h_NRPE.pdf

This will allow you to monitor a service and restart it if an issue occurs.

Re: Help with adding custom service

Posted: Fri Dec 14, 2012 5:11 pm
by eltrasimaco
Or create a service check with a custom command (shellscript) something like
#!/bin/sh
RES=0;if ! /bin/ps -C CrazyService >/dev/null; then RES=2; fi
exit $RES