05-27-2013 09:01 AM
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?
05-28-2013 01:25 AM
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).