There are multiple times when JAVA instance is down due to various reasons but admins are not aware of downtime immediately which causes escalations or penalty.
Generally we check the status of java services of server through
'jcmon pf='profile path'. All services should be in running state ideally.In case they are in stopped or starting state,it means java instance is not working.
So we can create a alert which can alert SAP admins in case jcmon/java services are down so that admins can act immediately without any delay.
Steps are as follows:
Write a script in shell using various functions like SAPcontrol, mailx etc.
There is a service in SAP called SAPcontrol via which we can create an alert when server or dispatcher is in stopped/not running state:
SAPcontrol -nr 00 -function J2EEGetProcessList |grep -i Stopped -- server is in stop state
This Function will display the current status of running/stopped server and dispatcher.
In case services are in stopped mode, use mailx command in unix to send alert across mails. In case the condition meets: (sapcontrol -nr 00 -function J2EEGetProcessList |grep -i Stopped), the alert will go to admin's mail ids or mobile no.
for mail alerts--mailx "subject" recipients list
for mobile alerts--mailx "subject" mobile-no.@domain.com