/[mon-modules]/sap.monitor
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sap.monitor

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dpavlin, Wed Jul 10 12:10:21 2002 UTC revision 1.4 by dpavlin, Wed Jul 10 12:30:23 2002 UTC
# Line 3  Line 3 
3  # Author:       Dobrica Pavlinusic, dpavlin@rot13.org  # Author:       Dobrica Pavlinusic, dpavlin@rot13.org
4  # Description:  monitor sap servers using sapinfo from RFCSDK  # Description:  monitor sap servers using sapinfo from RFCSDK
5  #  #
6  # Usage: sap.monitor [-h ashost filter] [-s sysnr filter]  # Usage: sap.monitor [-[hH] ashost only/ignore] [-[sS] sysnr only/ignore]
7  #  #
8    # e.g.  sap.monitor -s 20       will scan only hosts with sysnr == 20
9    #       sap.monitor -S 20       will scan only hosts with sysnr != 20
10    
11  use strict;  use strict;
12  use Getopt::Std;  use Getopt::Std;
# Line 37  foreach (@config) { Line 39  foreach (@config) {
39          my ($ashost,$sysnr) = split(/\t+/,$_,2);          my ($ashost,$sysnr) = split(/\t+/,$_,2);
40          if ($ashost && $ashost ne "" && $sysnr && $sysnr ne "" &&          if ($ashost && $ashost ne "" && $sysnr && $sysnr ne "" &&
41                  (($opts{h} && $ashost =~ m/$opts{h}/) || not $opts{h}) &&                  (($opts{h} && $ashost =~ m/$opts{h}/) || not $opts{h}) &&
42                  (($opts{s} && $sysnr  =~ m/$opts{s}/) || not $opts{s}) ) {                  (($opts{s} && $sysnr  =~ m/$opts{s}/) || not $opts{s}) &&
43                    (($opts{H} && $ashost !~ m/$opts{H}/) || not $opts{H}) &&
44                    (($opts{S} && $sysnr  !~ m/$opts{S}/) || not $opts{S}) ) {
45                  my $output = `$SAPINFO trace=0 ashost=$ashost sysnr=$sysnr`;                  my $output = `$SAPINFO trace=0 ashost=$ashost sysnr=$sysnr`;
46                  $output =~ m/System ID\s+(\w+)/;                  $output =~ m/System ID\s+(\w+)/;
47                  my $sys_id = $1 || "";                  my $sys_id = $1 || "";

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26