cancel
Showing results for 
Search instead for 
Did you mean: 

Script to check if SAP is up

Former Member
0 Kudos

Hey guys,

Does anyone have a unix script that checks if SAP is up? We're looking for something that can be automated via cron for example that can wake our sleeping unix guy if the system falls over.

Cheers!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please check this note.

34998 Checking on OS level whether R/3 is running

Award points if hepful.

Thanks,

Tanuj

Former Member
0 Kudos

Improving on the script in the note, which requires the SID and number of processes to be hard-coded, the script below checks the profile and calculates how many processes there should be. Additionally, the SID is passed as a parameter to the script. However, if the number of processes is changed in the profile and the SAP system not restarted, then the script will report that the system is down.

#!/bin/ksh

  1. count x workpocesses plus dispatcher plus grep-process

  2. for R/3 system with System-ID SID

#

SID=$1

PROCESSCOUNT=`expr 1 $(grep wp_no \`ps -ef|grep dw.sap$|head -1|cut -c 71-\`|sed 's/^.*= / + /')` if [[ `ps -ef|grep dw.sap$|grep -v grep|wc -l` -eq $PROCESSCOUNT ]] then

echo "system seems to be up"

else

echo "system seems to be down"

fi

Answers (1)

Answers (1)

sascha_tubbesing
Contributor
0 Kudos

Hi,

why investing time into something what RZ20 already is able to do?

With GRMG monitoring you can not only check if the system is up, but if the application gives an defined answer, so if the application is up and running.

You can then for example create an auto reaction method which sends an email to the admin.

Regards,

Sascha

Former Member
0 Kudos

Thanks Sascha, but it's too hard. I could manually log on and check for a year, or install ITO openview and configure from it scratch in the time it would take to read up on CRMG.

I only briefly looked at RZ20 and instantly thought, "Which madman designed this?!". Life is too short. Additionally, I've never met anyone who bothered to get CCMS monitoring working - even SAP employees say it's too hard.

sascha_tubbesing
Contributor
0 Kudos

Hi Philip.

I justed wanted to reply to your remarks about RZ20.

I agree with you, that the UI is quite old fashioned, not to say ugly.

But nonetheless RZ20 (and surroundings) is a very powerfull and reliable tool.

And it is not that hard to setup. Create an RFC connection, do a few settings and you see your remote SAP system...

We have many SAP customers using this and if my colleagues say: it is too hard, please tell them first to have a look into it, or maybe eben visit some education classes.

If it is only the one script you need, of course RZ20 is overkill for this.

But otherwise it really is worth having a look into it.

All third party products only have a nicer user-interface, they still rely on the same data as RZ20. And RZ20 is for free.

Enough now for the praise

Have fun!

Regards,

Sascha