diff --git a/xCAT-rmc/plugin/rmcmon.pm b/xCAT-rmc/plugin/rmcmon.pm index 8ba7d0aac..015396b05 100644 --- a/xCAT-rmc/plugin/rmcmon.pm +++ b/xCAT-rmc/plugin/rmcmon.pm @@ -487,15 +487,10 @@ sub config { my $version_string; if ($rsct_ver) {$version_string="RSCT_VER=$rsct_ver"; } - my $result=`$version_string $::XCATROOT/sbin/rmcmon/mkrmcresources $::XCATROOT/lib/perl/xCAT_monitoring/rmc/resources/sn 2>&1`; - if ($?) { - my $error= "Error when creating predefined resources on $localhostname:\n$result"; - reportError($error, $callback); - } + my $result; if ($isSV) { - $result=`$version_string $::XCATROOT/sbin/rmcmon/mkrmcresources $::XCATROOT/lib/perl/xCAT_monitoring/rmc/resources/node 2>&1`; - } else { - $result=`$version_string $::XCATROOT/sbin/rmcmon/mkrmcresources $::XCATROOT/lib/perl/xCAT_monitoring/rmc/resources/mn 2>&1`; + $result=`$version_string $::XCATROOT/sbin/rmcmon/mkrmcresources $::XCATROOT/lib/perl/xCAT_monitoring/rmc/resources/sn 2>&1`; } else { + $result=`$version_string $::XCATROOT/sbin/rmcmon/mkrmcresources $::XCATROOT/lib/perl/xCAT_monitoring/rmc/resources/mn 2>&1`; } if ($?) { my $error= "Error when creating predefined resources on $localhostname:\n$result"; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AIXNodeCoreDump.pm b/xCAT-rmc/resources/mn/IBM.Condition/AIXNodeCoreDump.pm new file mode 100644 index 000000000..eaedfcbb9 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AIXNodeCoreDump.pm @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +$RES::Condition{'AIXNodeCoreDump'} = { + Name => q(AIXNodeCoreDump), + ResourceClass => q(IBM.Sensor), + EventExpression => q(String=?"%label = CORE_DUMP%"), + EventDescription => q(An event will be generated when a core dump is logged in the AIX Error log of a node in the cluster.), + SelectionString => q(Name="ErrorLogSensor"), + ManagementScope => q(4), + Severity => q(0), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AllServiceableEvents.pm b/xCAT-rmc/resources/mn/IBM.Condition/AllServiceableEvents.pm new file mode 100644 index 000000000..540b71e80 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AllServiceableEvents.pm @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +$RES::Condition{'AllServiceableEvents'} = { + Name => q(AllServiceableEvents), + ResourceClass => q(IBM.Sensor), + EventExpression => q(String=?"LSSVCEVENTS_ALL%"), + EventDescription => q(An event will be generated whenever there is outpout from running sensor related to any serviceable events.), + SelectionString => q(Name="CSMServiceableEventSensor"), + ManagementScope => q(4), + Severity => q(0), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeAnyLoggedError.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeAnyLoggedError.pm new file mode 100644 index 000000000..27e922cb5 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeAnyLoggedError.pm @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeAnyLoggedError'} = { + Name => q(AnyNodeAnyLoggedError), + ResourceClass => q(IBM.Sensor), + EventExpression => q(String != ""), + EventDescription => q(An event will be generated when an error is logged to either the AIX Error Log or the Linux Syslog of a node in the cluster.), + SelectionString => q(Name="ErrorLogSensor"), + ManagementScope => q(4), + Severity => q(0), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemInodesUsed.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemInodesUsed.pm new file mode 100644 index 000000000..18fe9b4a5 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemInodesUsed.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeFileSystemInodesUsed'} = { + Name => q(AnyNodeFileSystemInodesUsed), + ResourceClass => q(IBM.FileSystem), + EventExpression => q(PercentINodeUsed>90), + EventDescription => q(An event will be generated when more than 90 percent of the total inodes in the file system is in use.), + RearmExpression => q(PercentINodeUsed<75), + RearmDescription => q(A rearm event will be generated when the percentage of the inodes used in the file system falls below 75 percent.), + ManagementScope => q(4), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemSpaceUsed.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemSpaceUsed.pm new file mode 100644 index 000000000..09fec0f1e --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeFileSystemSpaceUsed.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeFileSystemSpaceUsed'} = { + Name => q(AnyNodeFileSystemSpaceUsed), + ResourceClass => q(IBM.FileSystem), + EventExpression => q(PercentTotUsed>90), + EventDescription => q(An event will be generated when more than 90 percent of the total space of the file system is in use.), + RearmExpression => q(PercentTotUsed<75), + RearmDescription => q(A rearm event will be generated when the percentage of the space used in the file system falls below 75 percent.), + ManagementScope => q(4), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeNetworkInterfaceStatus.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeNetworkInterfaceStatus.pm new file mode 100644 index 000000000..7d9912347 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeNetworkInterfaceStatus.pm @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeNetworkInterfaceStatus'} = { + Name => q(AnyNodeNetworkInterfaceStatus), + ResourceClass => q(IBM.NetworkInterface), + EventExpression => q(OpState!=1), + EventDescription => q(An event will be generated whenever any network interface on the node is not online.), + RearmExpression => q(OpState=1), + RearmDescription => q(A rearm event will be generated when the network interface on the node becomes online again), + ManagementScope => q(4), + Severity => q(2), + +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodePagingPercentSpaceFree.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodePagingPercentSpaceFree.pm new file mode 100644 index 000000000..2d219090c --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodePagingPercentSpaceFree.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodePagingPercentSpaceFree'} = { + Name => q(AnyNodePagingPercentSpaceFree), + ResourceClass => q(IBM.Host), + EventExpression => q(PctTotalPgSpFree<10), + EventDescription => q(An event will be generated when the total amount of free paging space falls below 10 percent.), + RearmExpression => q(PctTotalPgSpFree>15), + RearmDescription => q(A rearm event will be generated when the free paging space increases to 15 percent.), + ManagementScope => q(4), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeProcessorsIdleTime.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeProcessorsIdleTime.pm new file mode 100644 index 000000000..262b01511 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeProcessorsIdleTime.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeProcessorsIdleTime'} = { + Name => q(AnyNodeProcessorsIdleTime), + ResourceClass => q(IBM.Host), + EventExpression => q(PctTotalTimeIdle>=70), + EventDescription => q(An event will be generated when the average time all processors are idle at least 70 percent of the time.), + RearmExpression => q(PctTotalTimeIdle<10), + RearmDescription => q(A rearm event will be generated when the idle time decreases below 10 percent.), + ManagementScope => q(4), + Severity => q(0), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeTmpSpaceUsed.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeTmpSpaceUsed.pm new file mode 100644 index 000000000..7c0af7881 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeTmpSpaceUsed.pm @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeTmpSpaceUsed'} = { + Name => q(AnyNodeTmpSpaceUsed), + 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 /tmp file system is in use.), + RearmExpression => q(PercentTotUsed<75), + RearmDescription => q(A rearm event will be generated when the percentage of the space used in the /tmp file system falls below 75 percent.), + SelectionString => q(Name="/tmp"), + ManagementScope => q(4), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeVarSpaceUsed.pm b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeVarSpaceUsed.pm new file mode 100644 index 000000000..483321698 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/AnyNodeVarSpaceUsed.pm @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +$RES::Condition{'AnyNodeVarSpaceUsed'} = { + Name => q(AnyNodeVarSpaceUsed), + 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.), + 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.), + SelectionString => q(Name="/var"), + ManagementScope => q(4), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/IBSwitchLog.pm b/xCAT-rmc/resources/mn/IBM.Condition/IBSwitchLog.pm new file mode 100644 index 000000000..8e4d07776 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/IBSwitchLog.pm @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$RES::Condition{'IBSwitchLog'} = { + Name => q(IBSwitchLog), + ResourceClass => q(IBM.Sensor), + EventExpression => q(String != ""), + EventDescription => q(An event will be generated when errors are logged to the Syslog in the local node for IB. The errors are saved in the String attribute in the event. However, if the String attribute in the event starts with XCAT_MONAIXSYSLOG_FILE:filename, then the errors can be found in the file. In this case, it is the responsibility of the response that associates with the condition to remove the temporary file.), + SelectionString => q(Name="IBSwitchLogSensor"), + Severity => q(0), +}; + + +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability.pm b/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability.pm new file mode 100644 index 000000000..973eda74b --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability.pm @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +$RES::Condition{'NodeReachability'} = { + Name => q(NodeReachability), + ResourceClass => q(IBM.MngNode), + EventExpression => q(Status!=Status@P), + EventDescription => q(An event will be generated when a status changes), + ManagementScope => q(1), + Severity => q(2), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability_Batch.pm b/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability_Batch.pm new file mode 100644 index 000000000..ea1b00268 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/NodeReachability_Batch.pm @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; +use xCAT::Utils; + +if (exists($ENV{RSCT_VER})) { + my $rsct_ver=$ENV{RSCT_VER}; + if (xCAT::Utils->CheckVersion($rsct_ver, "2.3.5.0") < 0) { + exit(0); + } +} + +$RES::Condition{'NodeReachability_Batch'} = { + Name => q(NodeReachability_Batch), + ResourceClass => q(IBM.MngNode), + EventExpression => q(Status!=Status@P), + EventDescription => q(An event will be generated when a status changes), + ManagementScope => q(1), + EventBatchingInterval => q(60), + EventBatchingMaxEvents => q(200), + Severity => q(2), +}; + + +1; diff --git a/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase.pm b/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase.pm new file mode 100644 index 000000000..60994f12b --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase.pm @@ -0,0 +1,8 @@ +#!/usr/bin/perl + +$RES::EventResponse{'LogEventToxCATDatabase'} = { + Name => q(LogEventToxCATDatabase), + Locked => q(0), + Actions => q({[updatexCAT,{127},{0},{86400},/opt/xcat/sbin/rmcmon/logeventtoxcat,3,0,0,0,{},0]}), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase_Batch.pm b/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase_Batch.pm new file mode 100644 index 000000000..b9d769e41 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.EventResponse/LogEventToxCATDatabase_Batch.pm @@ -0,0 +1,20 @@ +#!/usr/bin/perl +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; +use xCAT::Utils; + +if (exists($ENV{RSCT_VER})) { + my $rsct_ver=$ENV{RSCT_VER}; + if (xCAT::Utils->CheckVersion($rsct_ver, "2.3.5.0") < 0) { exit 0;} +} + +$RES::EventResponse{'LogEventToxCATDatabase_Batch'} = { + Name => q(LogEventToxCATDatabase_Batch), + Locked => q(0), + EventBatching => q(1), + Actions => q({[updatexCAT,{127},{0},{86400},/opt/xcat/sbin/rmcmon/logeventtoxcat,3,0,0,0,{},0]}), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.EventResponse/UpdatexCATNodeStatus_Batch.pm b/xCAT-rmc/resources/mn/IBM.EventResponse/UpdatexCATNodeStatus_Batch.pm new file mode 100644 index 000000000..819c52b50 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.EventResponse/UpdatexCATNodeStatus_Batch.pm @@ -0,0 +1,20 @@ +#!/usr/bin/perl +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; +use xCAT::Utils; + +if (exists($ENV{RSCT_VER})) { + my $rsct_ver=$ENV{RSCT_VER}; + if (xCAT::Utils->CheckVersion($rsct_ver, "2.3.5.0") < 0) { exit 0;} +} + +$RES::EventResponse{'UpdatexCATNodeStatus_Batch'} = { + Name => q(UpdatexCATNodeStatus_Batch), + Locked => q(0), + EventBatching => q(1), + Actions => q({[updatexCAT,{127},{0},{86400},/opt/xcat/sbin/rmcmon/updatexcatnodestatus,3,0,0,0,{},0]}), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Sensor/IBSwitchLogSensor.pm b/xCAT-rmc/resources/mn/IBM.Sensor/IBSwitchLogSensor.pm new file mode 100644 index 000000000..e8832b75b --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Sensor/IBSwitchLogSensor.pm @@ -0,0 +1,21 @@ +#!/usr/bin/perl +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; + +my $cmd; +if ($^O =~ /^linux/i) { $cmd="$::XCATROOT/sbin/rmcmon/monerrorlog";} +else {$cmd="$::XCATROOT/sbin/rmcmon/monaixsyslog";} + +$RES::Sensor{'IBSwitchLogSensor'} = { + Name => q(IBSwitchLogSensor), + Command => "$cmd -p local6.notice -f /var/log/xcat/syslog.fabric.notices", + Description => "This sensor monitors the errors logged by IB Switch management software. The String attribute will get updated with the IB related errors happend within the last 60 seconds. If the length of the error messages is too long, the errors will be saved into a temporary file under /var/opt/xcat_aix_syslog. And the String attrubute will be updated with the file name instead. The format is XCAT_MONAIXSYSLOG_FILE:filename.", + UserName => q(root), + RefreshInterval => q(60), + ErrorExitValue => q(1), + ControlFlags => q(0), +}; +1; diff --git a/xCAT-rmc/resources/sn/IBM.Condition/CFMRootModTimeChanged.pm b/xCAT-rmc/resources/sn/IBM.Condition/CFMRootModTimeChanged.pm deleted file mode 100644 index c5306f4bb..000000000 --- a/xCAT-rmc/resources/sn/IBM.Condition/CFMRootModTimeChanged.pm +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/perl - -$RES::Condition{'CFMRootModTimeChanged'} = { - Name => q(CFMRootModTimeChanged), - ResourceClass => q(IBM.Sensor), - EventExpression => q(String!=String@P), - EventDescription => q(An event will be generated whenever a file under /cfmroot is added or modified.), - SelectionString => q(Name="CFMRootModTime"), - ManagementScope => q(1), - Severity => q(0), -}; -1; diff --git a/xCAT-rmc/resources/sn/IBM.Sensor/CFMRootModTime.pm b/xCAT-rmc/resources/sn/IBM.Sensor/CFMRootModTime.pm deleted file mode 100644 index 48dcb2d18..000000000 --- a/xCAT-rmc/resources/sn/IBM.Sensor/CFMRootModTime.pm +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -BEGIN -{ - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; -} - -$RES::Sensor{'CFMRootModTime'} = { - Name => q(CFMRootModTime), - Command => "$::XCATROOT/sbin/rmcmon/mtime /cfmroot", - UserName => q(root), - RefreshInterval => q(60), -}; -1;