Command to monitor/alert when a process is not running in UNIX or Linux?
Create a new Command metric which returns a count of running processes:
Monitor Solution 8.x:
Name: Count of running processnameprocesses
Polling interval: 60 seconds
Data type: Numeric
Use: Command Line: ps -eoargs|awk /processname/'{print $0}'|grep -v -c 'awk /processname'
Return value column: 0
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