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