SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Perl script to check the status of the SAP through tthe Web



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 18, 2007 8:15 pm    Post subject: Perl script to check the status of the SAP through tthe Web Reply with quote

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

Code:
#########################################################################################
# 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:
#
#<form method="GET" name="sapcheck" action="http://myserver.com/cgi-bin/status.pl">
#  <p><select name="SYS" size="1">
#    <option selected value="RTC">RTC</option>
#    <option value="DEV">DEV</option>
#    <option value="PRD">PRD</option>
#  </select><input type="submit" value="submit"></p>
#</form>
#
# And it will look like this:

 




#########################################################################################
#
print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
#
print "<HTML><BODY>";
#
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 = <FILE>) {
      if ($i == 0) {
            print "<B>When you clicked on the button $b was up and running!</B><P>";
      }
      print "<small>$a<P></small>";
      $i+=1;
}
print "</small>";
if ($i == 0) {
      print "<B>When you clicked on the button $b was down!</B>";
}
print "</HTML></BODY>";
#
#########################################################################################
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.