Check the age of a process

David Jones <[email protected]>
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <DM6PR19MB2233E2B266BDA3D83AE558A5C6AB0@DM6PR19MB2233.namprd19.prod.outlook.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.