Linux – Generic Nagios plugin to check if a specific process/service is running

centoslinuxnagiosUbuntu

I see on http://exchange.nagios.org that there are not plugins to check if sendmail, xinetd, automount, ypserv, ypbind, mailscanner, mcafee, clamav, samba server, and openvpn are running.

Of course all these should be stable programs, but they are critical, so I would like to check if they are running.

Question

Does there exist a generic plugin to check for specific processes?

Best Answer

I use the standard NAGIOS check_procs plugin, with the -C flag, shown here being invoked from nrpe.cfg via NRPE:

command[check_spamd]=/usr/lib/nagios/plugins/check_procs -c 1: -w 3: -C spamd

which will WARN if it doesn't find at least three processes with the executable name (not counting path) spamd, and which will CRIT if it doesn't find at least one.