diff --git a/xCAT-server-2.0/lib/xcat/monitoring/snmpmon.pm b/xCAT-server-2.0/lib/xcat/monitoring/snmpmon.pm index f35ba4349..34cbba20b 100644 --- a/xCAT-server-2.0/lib/xcat/monitoring/snmpmon.pm +++ b/xCAT-server-2.0/lib/xcat/monitoring/snmpmon.pm @@ -129,6 +129,7 @@ sub configSNMP { # then stop it and restart it again so that it reads our new # snmptrapd.conf configuration file. Then the process chomp(my $pid= `/bin/ps -ef | /bin/grep snmptrapd | /bin/grep -v grep | /bin/awk '{print \$2}'`); + print "pid=$pid here\n"; if($pid){ `/bin/kill -9 $pid`; } @@ -177,14 +178,14 @@ sub stop { } } - # now check to see if the daemon is running. If it is then we need to restart + # now check to see if the daemon is running. If it is then we need to resart or stop? # it with the new snmptrapd.conf file that will not forward events to RMC. - my $pid=""; - chomp($pid= `/bin/ps -ef | /bin/grep snmptrapd | /bin/grep -v grep | /bin/awk '{print $\2}'`); + chomp(my $pid= `/bin/ps -ef | /bin/grep snmptrapd | /bin/grep -v grep | /bin/awk '{print \$2}'`); + print "pid=$pid\n"; if($pid){ `/bin/kill -9 $pid`; # start it up again! - system("/usr/sbin/snmptrapd"); + #system("/usr/sbin/snmptrapd"); } return (0, "stopped"); diff --git a/xCAT-server-2.0/sbin/xcat_traphandler b/xCAT-server-2.0/sbin/xcat_traphandler index 1983b53b6..b6357bffb 100755 --- a/xCAT-server-2.0/sbin/xcat_traphandler +++ b/xCAT-server-2.0/sbin/xcat_traphandler @@ -21,8 +21,7 @@ my $info; my $severity_type; my $severity; - -my $host=; +my $host=; chomp($host); my $ip=; chomp($ip); @@ -31,6 +30,7 @@ my $holder; my $begin=1; my $pair; + while ($temp=) { chomp($temp); my $temp1=$temp; #save the one with quotes @@ -58,22 +58,20 @@ while ($temp=) { } } - print "pair=$pair\n"; - @a=split(/ /, $pair); $oid=shift @a; $value=join(' ', @a); $message .= " $oid=$value\n"; - #for BladeCenter MM traps, creat a brief message - if ($oid =~ /BLADESPPALT-MIB::spTrapAppId/) { + #for BladeCenter MM traps and RSA II traps, creat a brief message + if ($oid =~ /BLADESPPALT-MIB::spTrapAppId|RSASPPALT-MIB::ibmSpTrapAppId/) { $briefmsg .= " App ID: $value\n"; } - elsif ($oid =~ /BLADESPPALT-MIB::spTrapAppType/) { - $briefmsg .= " Alert Type: $value\n"; + elsif ($oid =~ /BLADESPPALT-MIB::spTrapAppType|RSASPPALT-MIB::ibmSpTrapAppType/) { + $briefmsg .= " App Alert Type: $value\n"; } - elsif ($oid =~ /BLADESPPALT-MIB::spTrapMsgText/) { + elsif ($oid =~ /BLADESPPALT-MIB::spTrapMsgText|RSASPPALT-MIB::ibmSpTrapMsgText/) { $briefmsg .= " Message: $value\n"; } elsif ($oid =~ /BLADESPPALT-MIB::spTrapBladeName/) { @@ -87,7 +85,7 @@ while ($temp=) { elsif (($oid =~ /BLADESPPALT-MIB::spTrapSourceId/)) { $briefmsg .= " Error Source=$value\n"; } - elsif ($oid =~ /BLADESPPALT-MIB::spTrapPriority/) { + elsif ($oid =~ /BLADESPPALT-MIB::spTrapPriority|RSASPPALT-MIB::ibmSpTrapPriority/) { # Critical Alert(0), Major(1), Non-Critical Alert(2), System Alert(4), # Recovery Alert(8), Informational Only Alert(255) if ($value==0) { @@ -112,19 +110,7 @@ while ($temp=) { } #elsif ($oid =~ /enterprises\.3183\.1\.1\.1/) { #IPMI starts here # ; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.1\.1\.3/) { #RSA starts here, TODO: get MIB, change here -# $briefmsg .= " Node: $value\n"; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.1\.1\.7/) { -# $briefmsg .= " Message: $value\n"; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.1\.1\.5/) { -# $briefmsg .= " Alert Type: $value\n"; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.2\.1\.1\.3/) { -# $briefmsg .= " Node: $value\n"; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.2\.1\.1\.9/) { -# $briefmsg .= " Message: $value\n"; -# } elsif ($oid =~ /enterprises\.2\.6\.158\.2\.1\.1\.7/) { -# $briefmsg .= " Alert Type: $value\n"; -# } +# } } if ($node1) {$info= getMoreInfo($node1);}