What is the correlation you have made between these hung processes and 
processes that are not attached to a TTY (since that is what you are 
grepping for)? Ideally you want to test the results of the process rather 
than make guesses based off the process table. For example, if the 
processes are webserver processes, a better check is check_http to ensure 
that the webserver is handling requests. Last resorts can even be checking 
that a log file is being updated, if you are certain it's always updated 
within a certain time period under working conditions.

If you do end up wanting to do checks based on process grepping, there is 
the default check_procs[1]. This allows you to perform checks based on the 
number of processes found with filters. It does not support only selecting 
processes which are not attached to a TTY (service processes generally are 
not anyways). If you do need to write something custom, you can do so 
fairly easily. The script just needs to exit with the proper return codes 
for ok, critical, warning, and unknown. There are plenty of details in the 
nagios plugin development guidelines document[2]. There are libraries for 
multiple languages that help with writing these checks, but they are not 
required. I personally prefer nagiosplugin for python.

[1] https://www.monitoring-plugins.org/doc/man/check_procs.html
[2] http://nagios-plugins.org/doc/guidelines.html
[3] https://pypi.python.org/pypi/nagiosplugin/

Regards,
Jordan Metzmeier

On Wednesday, July 23, 2014 12:29:30 PM UTC-5, Howard wrote:
>
> Is there anyone on the list who have written Nagios nrpe plugins?  I 
> have a situation with our application where some processes get hung.  I 
> use a compound ps aux | grep something | grep " ?  " to find those 
> processes. 
>
> I'd like to have a plugin that would run that ps aux and count the 
> number of lines returned.  We could even go so far as to set warning 
> (-w) and critical (-c) thresholds.  Truly, if there are any, I want a 
> critical warning on my Nagios monitor screen so that I may log into the 
> server and kill off the hung processes. 
>
> Thoughts?? 
>
> Howard 
>

-- 
-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to