Re: Monitor process older than (103 Views)
Posts: 21
Registered: ‎01-15-2013
Message 1 of 2 (128 Views)

Monitor process older than



I'm looking to monitor (on an HP-UX agent) if a specific process is older then 5 days. "ps -ef | grep "process" " of course gives me the details of the process but is there an easy way to monitor the date comparing it to the actual date to generate a critical alarm if the process has been running for over 5 days?



Please use plain text.
Honored Contributor
Goran Koruga
Posts: 1,285
Registered: ‎12-05-2002
Message 2 of 2 (103 Views)

Re: Monitor process older than



You can write yourself a little tool using pstat(2) interface (in particular, pstat_getproc()) - the check would be rather trivial since it returns start time in seconds since epoch. Alternatively, there are various date parsing libraries/modules out there that can be used (I've used several Perl modules in the past).




Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation