cancel
Showing results for 
Search instead for 
Did you mean: 

SAPRouter script

Former Member
0 Kudos

We run saprouter and the other day someone stopped it. This went unoticed and SAP could not then log in to the system.

Does anyone have a script that monitors a PID e.g

erdadm 15983 1 0 Mar 20 ? 1:58 saprouter -r

So that if it dies we would be alerted, I am assuming a Unix script is the best way of tackling this ??

Anyone else doing this for a PID

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I would like to write a script to remove transports that have successfully transported and are over 7 days old. In STMS currently we have a list of every transport that has ever been sent and there is no need. Note that via SE10 we still want to see transport history even for old transports just remove the old ones from STMS. Hopefully I feel some script does this job and no idea on this scripts.

Can someone throw light on this and help me out.

Thanks & Regards,

Bharadwaj.

Former Member
0 Kudos

A simple ksh script should do it.

You will need a little loop with a wait in it, or execute teh script via a kron job.

The important bit would be:

$IS_ROUTER_ALIVE=`ps -ef | grep "saprouter -r" | wc -l | grep -v grep `

The wc -l will return 1 if it is there and 0 is it is not there and store it in the variable $IS_ROUTER_ALIVE which you can then test in an if statement. please note that the statement is enclosed in back tick `

Alternativily you could do:

ps -ef | grep "saprouter -r" | grep -v grep > /dev/null

and then test the grep result variable which is in $?. It will be 0 if lines were found or 1 is lines were not found.

Probably a load more ways to do this but those two should get you going.

Former Member
0 Kudos

Richard,

Thanks thats been very helpfull ....