/[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.10 by dpavlin, Wed Aug 7 09:57:59 2002 UTC revision 1.13 by dpavlin, Thu Oct 2 08:18:32 2003 UTC
# Line 29  my $SAPINFO = "/usr/local/bin/sapinfo"; Line 29  my $SAPINFO = "/usr/local/bin/sapinfo";
29  my $repeat = 3;  my $repeat = 3;
30  # seconds to wait between retries  # seconds to wait between retries
31  my $repeat_wait = 5;  my $repeat_wait = 5;
32    # sapinfo timeout
33    my $sapinfo_timeout = 10;
34    
35  my %opts;  my %opts;
36  getopt('h:s:H:S:', \%opts);  getopt('h:s:H:S:', \%opts);
# Line 62  foreach (@config) { Line 64  foreach (@config) {
64                  my $output;                  my $output;
65                  my $sys_id;                  my $sys_id;
66                  for(my $i=0; $i<$repeat; $i++) {                  for(my $i=0; $i<$repeat; $i++) {
67                          $output = `$SAPINFO trace=0 ashost=$ashost sysnr=$sysnr`;                          eval {
68                                    local $SIG{ALRM} = sub { die "timeout\n"; };
69                                    alarm $sapinfo_timeout; # wait for sapinfo to finish
70                                    $output = `$SAPINFO trace=0 ashost=$ashost sysnr=$sysnr`;
71                            };
72                            alarm 0; # turn alarm off
73                          undef $sys_id;                          undef $sys_id;
74                            $output = "" if (! defined $output);
75                          if ($output =~ m/System\s+ID\s+(\w+)/i) {                          if ($output =~ m/System\s+ID\s+(\w+)/i) {
76                                  $sys_id = $1;                                  $sys_id = $1;
77                                  last;                                  last;

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26