Friday, October 15, 2010

Perl script to check the status of the SAP systems through the WEB

#########################################################################################
# This little PERL script runs on a web server that can reach the SAP
# systems on the lan. When called, it checks the status of an SAP system
# and lets us know, whether it is up or down. Sapinfo.exe has to be
# copied to cgi-bin. This particular script runs on NT with IIS.
# Change the first two lines to the location of your Perl to run it on UNIX.
# It be called using the following html tags:
#
#


#


#

#
# And it will look like this:


#########################################################################################
#
print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
#
print "";
#
require "cgi-lib.pl";
&ReadParse;
$i = 0;
$b = $in{'SYS'};
#
if ($b =~ /RTC/) {
open (FILE, "sapinfo -3 -h saphost1 -s 00 -u sap* -p passwd1 |");
}
else {
open (FILE, "sapinfo -3 -h saphost2 -s 99 -u sap* -p passwd2 |");
}
#
while ($a = ) {
if ($i == 0) {
print "When you clicked on the button $b was up and running!

";
}
print "$a

";
$i+=1;
}
print "";
if ($i == 0) {
print "When you clicked on the button $b was down!";
}
print "";
#
#########################################################################################

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites