From 6398d22f3529db69e320a796cde67a49cba91606 Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 17 Nov 2010 16:41:12 +0000 Subject: [PATCH] more on monitoring git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8188 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-rmc/plugin/rmcmon.pm | 24 ++++++++++++++++++- .../mn/IBM.Condition/VarSpaceUsed.pm | 13 ++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 xCAT-rmc/resources/mn/IBM.Condition/VarSpaceUsed.pm diff --git a/xCAT-rmc/plugin/rmcmon.pm b/xCAT-rmc/plugin/rmcmon.pm index 9d1b0f753..a30ad8af5 100644 --- a/xCAT-rmc/plugin/rmcmon.pm +++ b/xCAT-rmc/plugin/rmcmon.pm @@ -1146,6 +1146,13 @@ sub addNodes { if ($?) { reportError($result, $callback); } } } + + #define AllServiceableEvents_B condition on the HMC + $result=`CT_MANAGEMENT_SCOPE=3 /usr/bin/mkrsrc-api IBM.Condition::Name::"AllServiceableEvents_B"::ResourceClass::"IBM.Sensor"::EventExpression::"String=?\\\"LSSVCEVENTS_ALL%\\\""::SelectionString::"Name=\\\"CSMServiceableEventSensor\\\""::NodeNameList::{\\\"$node\\\"}::EventBatchingInterval::1::BatchedEventRetentionPeriod::72 2>&1`; + if (($?) && ($result !~ /2618-201|2618-008|2636-050/)){ + reportError($result, $callback); + } + } } } @@ -1273,8 +1280,21 @@ sub removeNodes { foreach my $node (@mon_nodes) { if ($rmcHash{$node}) { + my $result=0; + if ($flag && $scope && (!$inactiveHash{$node})) { #remove AllServiceableEvents_B condition for HMC + $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node -l hscroot "lsrsrc-api -s IBM.Condition::\\\"Name='AllServiceableEvents_B'\\\" 2>&1"`; + if ($?) { + if ($result !~ /2612-023/) {#2612-023 no resources found error + reportError($result, $callback); + } + } + $result=`/usr/bin/rmcondition -f AllServiceableEvents_B:$node 2>&1`; + if ($?) { reportError($result, $callback); } + } + + #remove resource in IBM.MngNode class on server - my $result=`rmrsrc-api -s IBM.MngNode::"Name=\\\"\"$node\\\"\"" 2>&1`; + $result=`rmrsrc-api -s IBM.MngNode::"Name=\\\"\"$node\\\"\"" 2>&1`; if ($?) { if ($result =~ m/2612-023/) { #resource not found next; @@ -1301,6 +1321,7 @@ sub removeNodes { } if ($flag) { #hmc nodes + #remove the MCP $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node -l hscroot "lsrsrc-api -s IBM.MCP::\\\"NodeID=0x$ms_node_id\\\" 2>&1"`; if ($?) { if ($result !~ /2612-023/) {#2612-023 no resources found error @@ -1310,6 +1331,7 @@ sub removeNodes { } $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node -l hscroot "rmrsrc-api -s IBM.MCP::\\\"NodeID=0x$ms_node_id\\\" 2>&1"`; if ($?) { reportError($result, $callback); } + } else { #normal nodes push(@normal_nodes, $node); } diff --git a/xCAT-rmc/resources/mn/IBM.Condition/VarSpaceUsed.pm b/xCAT-rmc/resources/mn/IBM.Condition/VarSpaceUsed.pm new file mode 100644 index 000000000..4c29bbe42 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/VarSpaceUsed.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'VarSpaceUsed'} = { + Name => q(VarSpaceUsed), + ResourceClass => q(IBM.FileSystem), + EventExpression => q(PercentTotUsed>90), + EventDescription => q(An event will be generated when more than 90 percent of the total space in the /var file system is in use on the local node.), + RearmExpression => q(PercentTotUsed<75), + RearmDescription => q(A rearm event will be generated when the percentage of the space used in the /var file system falls below 75 percent on the local node.), + SelectionString => q(Name="/var"), + Severity => q(2), +}; +1;