How to monitor if a process is not running in UNIX/Linux

Article:TECH138462  |  Created: 2010-08-25  |  Updated: 2013-10-25  |  Article URL http://www.symantec.com/docs/TECH138462
Article Type
Technical Solution


Issue



How can I monitor/alert when a process is not running in UNIX or Linux?


Environment



  • Monitor Solution for Servers 6.x
  • Monitor Solution for Servers 7.x

Solution



Create a new Command metric which returns a count of running processes:
 
Monitor Solution 6.x:
 
Name
Count of running processnameprocesses
Polling interval
60 seconds
Timeout
30 seconds
Command line
LC_ALL=C ps -eoargs|awk /processname/'{print $0}'|grep -v -c 'awk /processname'
Return value column
0
Data typeNumeric

  
Monitor Solution 7.x:
 
Name
Count of running processnameprocesses
Polling interval60 seconds

Data type
Numeric
Use: Command Lineps -eoargs|awk /processname/'{print $0}'|grep -v -c 'awk /processname'
Return value column0

Create a new a rule with a condition of “Is equal to 0” with an appropriate severity. If the desired process is not running, the metric will return a value of “0”, and the rule will trigger.
 
Note:  This command line syntax has been confirmed compatible on SLES, RHEL, AIX, and Solaris

 




Article URL http://www.symantec.com/docs/TECH138462


Terms of use for this information are found in Legal Notices