Re: Monitor process older than (151 Views)
Reply
Advisor
TravisBak
Posts: 21
Registered: ‎01-15-2013
Message 1 of 2 (176 Views)

Monitor process older than

Hello,

 

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?

 

Regards

Honored Contributor
Goran Koruga
Posts: 1,324
Registered: ‎12-05-2002
Message 2 of 2 (151 Views)

Re: Monitor process older than

Hello.

 

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).

 

Regards,

    Goran

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.