monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Check the age of a process


From: David Jones
Subject: Check the age of a process
Date: Tue, 20 Aug 2019 23:27:28 +0000

I searched the manual and Google'd but didn't find a way to do this natively inside monit.  Currently I am running a Nagios plugin script from Nagios Exchange.  Seems like this would be a natural addition to monit.

I have some scripts that our support team can run on a server that are like a tail command from our web filtering for troubleshooting blocks/allows.  I want to know if someone has left one running too long forgetting to close it.  In fact, it would nice to be able to kill a specific PID of the one that is running too long.  If it's possible to set an environment variable or something that could be passed to the exec, that would be perfect.

check process filter_grep_age matching filter_grep
    if timestamp is older than 10 hours then exec "/bin/kill ${FILTER_GREP_AGE_PID}"
    if timestamp is older than 8 hours then alert

Thanks,
Dave

reply via email to

[Prev in Thread] Current Thread [Next in Thread]