Monitor linux process age

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Monitor linux process age

Post by BanditBBS »

As the title of this post suggests, I want to monitor a specific process, and if it is running, make sure it hasn't been running over a certain amount of time. If it is running and has been for too long I want a critical message. Then I'll kick off an event handler to kill the process. Does anyone know of a check that can do what I want?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitor linux process age

Post by abrist »

There are a number of similar plugins on the exchange:
http://exchange.nagios.org/index.php?op ... ess%20time

If you are looking to roll your own, stackoverflow had a bunch of different options to check for process time in the following post:
http://stackoverflow.com/questions/6134 ... ux-process
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Monitor linux process age

Post by BanditBBS »

2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitor linux process age

Post by abrist »

Happy hunting!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Monitor linux process age

Post by BanditBBS »

Thanks abrist. Looks like I was posting my reply as you were posting yours.

Using check_proc_age.sh check instead. Now to modify it to use it as the event handler as well :) Thanks for the links anyway!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitor linux process age

Post by slansing »

Great! Let us know how this works out for you, it may be something we could document and add along side the basic service check documentation! :D
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitor linux process age

Post by abrist »

No problem. These forum race conditions: not enough F5 mashing I guess :P
I will lock 'er up.

EDIT: To many smilies in this thread. This is a place of business guys!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked