Re: Monitor process older than (158 Views)
Posts: 21
Registered: ‎01-15-2013
Message 1 of 2 (183 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?



Honored Contributor
Posts: 1,408
Registered: ‎12-05-2002
Message 2 of 2 (158 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).




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.