cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Availibility Script

Former Member
0 Kudos

I want to design a script which can ping all the SAP instances and give a (system is up/system is down) update. ( In HP -UX / Linux )

I have seen before, the script text looks like

*****sapgui <host1> <instancenumber1>

sapgui <host2> <instancenumber2>

.

.

.

sapgui <hostx><instancenumebrx>

****

After the script runs, the output is - system is up / system is down.

I am not so good at scripting, so If you can educate me, I can well go ahead and do it,

Thanks

Ciao.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

lgtst is another option for testing from the command line, have a look at Note 64015 (Description of test program lgtst). Dump the output of the lgtst command to a text file then grep the file for key words that you know mean the system is up, if you don't find them send an email using mailx or sendmail.

You should still try the CCMS option mentioned earlier in the thread, ccmsping can now monitor both the J2EE & ABAP stack and will actually do a logon to the system (ABAP at least) to prove it is up, sapinfo & lgtst essentially just query the ABAP message server. If you have a stalled database or all work processes in your system are consumed a sapinfo/lgtst check will most likely still work (giving a false result), but a ccmsping logon check will fail because the system is actually down. A further drawback with sapinfo is that it just tests a gateway/RFC connection not a dialogue connection, so it is possible for 32## ports to be blocked but monitoring on 33## ports to be working fine (another false positive).

What I do is monitor all systems will a ccmsping agent connected to my Solution Manager system, then monitor the solution manager system with a shell script, on a remote box, using lgtst (monitoring on the monitoring...). That way if solman goes down I know that don't have any monitoring/alerts running for the rest of my systems.

Daniel

Update -> here's quick an example of how we've got lgtst scripted for monitoring on AIX


#do the check and store result
lgtst -H servername -S 3600 -D 2 >> /tmp/check_sap_dev_avail.1.log 2>&1 &

#look for key items & set status
if [ `grep SID /tmp/check_sap_dev_avail.1.log | grep -c J2EE` -eq 1 ] ; then
   subj=$subj' SID ok;'
else
   subj=$subj' SID DOWN!;'
fi

#compare against the last run of the script, alert if results are different
. /tmp/check_sap_dev_avail.2.log
if [ "$subj2" != "$subj" ] ; then
   cat /tmp/check_sap_dev_avail.1.log | mailx -s "$subj" youremailaddress
   #log the change of status
   echo `date`': '$subj >> /usr/sap/scripts/monitor/availability_development.log
fi

#update the comparer log for the next run
rm /tmp/check_sap_dev_avail.2.log
echo 'subj2="'$subj'"' > /tmp/check_sap_dev_avail.2.log

Edited by: Daniel Parker on May 26, 2009 9:07 AM

Edited by: Daniel Parker on May 26, 2009 9:20 AM

markus_doehr2
Active Contributor
0 Kudos

I'd rather set up CCMS to do the monitoring - much easier and "build-in":

http://service.sap.com/monitoring

Markus

Former Member
0 Kudos

I suppose all the systems are down,

I mean - the central monitoring is not working , or is under maintainance.

Then ?

Former Member
0 Kudos

when all the systems are down or under maintenance, then what you want to monitor ?

however, you can create scripts which can monitor the work processes/ message server process/ listener/ saposcol processes etc.

not aware of any script seen as shown by you, however, if you not good at scripting,may be you can ask unix team to do that for you ? (but in SAP, normally unix team is only for 'Administrative' tasks)

but monitoring through CEN is really good

Former Member
0 Kudos

Hi,

The command shown in your script is used to connect to SAP system from front end machines. How can you use this in UNIX script ?

The tool suggested by Markus is really good but still if you want to enable the scripts on unix level for monitoring of the instances, you can try to ping the gateway or message server port or dispatcher port (Gateway Port will be 33<Your system number> and Message server port will be 36<Your system number>, dispatcher port 32<Your sytsem number>.

If these ports are responding means your instance is alive.

With Regards,

Saurabh

former_member204746
Active Contributor
0 Kudos

you can use program SAPINFO from RFC SDK kit.