From aef1d479ec551d5b6e7e9ef26d0967d19344ef4b Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 18 Nov 2010 23:12:25 +0000 Subject: [PATCH] conditons to monitorin services on the sn git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8208 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../mn/IBM.Condition/CheckDHCPonSN.pm | 14 ++++++++++ .../mn/IBM.Condition/CheckNAMEDonSN.pm | 14 ++++++++++ .../mn/IBM.Condition/CheckTFTPonSN.pm | 28 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 xCAT-rmc/resources/mn/IBM.Condition/CheckDHCPonSN.pm create mode 100644 xCAT-rmc/resources/mn/IBM.Condition/CheckNAMEDonSN.pm create mode 100644 xCAT-rmc/resources/mn/IBM.Condition/CheckTFTPonSN.pm diff --git a/xCAT-rmc/resources/mn/IBM.Condition/CheckDHCPonSN.pm b/xCAT-rmc/resources/mn/IBM.Condition/CheckDHCPonSN.pm new file mode 100644 index 000000000..a827b3aa0 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/CheckDHCPonSN.pm @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +$RES::Condition{'CheckDHCPonSN'} = { + Name => q(CheckDHCPonSN), + ResourceClass => q(IBM.Program), + EventExpression => q(Processes.CurPidCount == 0), + EventDescription => q(An event will be generated when the DHCP server is down on the service node. There may be other nodes in this management domain such as HMCs. To exclude them, just change the SelectionString to: "ProgramName=='dhcpd' && NodeNameList >< {'hmc1','hmc2}" where hmc1 and hmc2 are the names for the nodes that you want to exclude.), + RearmExpression => q(Processes.CurPidCount != 0), + RearmDescription => q(A rearm event will be generated when the DHCP server is up on the service node.), + SelectionString => q(ProgramName=='dhcpd'), + ManagementScope => q(4), + Severity => q(1), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/CheckNAMEDonSN.pm b/xCAT-rmc/resources/mn/IBM.Condition/CheckNAMEDonSN.pm new file mode 100644 index 000000000..470ffdfc3 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/CheckNAMEDonSN.pm @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +$RES::Condition{'CheckNAMEDonSN'} = { + Name => q(CheckNAMEDonSN), + ResourceClass => q(IBM.Program), + EventExpression => q(Processes.CurPidCount == 0), + EventDescription => q(An event will be generated when the name server is down on the service node. There may be other nodes in this management domain such as HMCs. To exclude them, just change the SelectionString to: "ProgramName=='named' && NodeNameList >< {'hmc1','hmc2}" where hmc1 and hmc2 are the names for the nodes that you want to exclude.), + RearmExpression => q(Processes.CurPidCount != 0), + RearmDescription => q(A rearm event will be generated when the name server is up on the service node.), + SelectionString => q(ProgramName=='named'), + ManagementScope => q(4), + Severity => q(1), +}; +1; diff --git a/xCAT-rmc/resources/mn/IBM.Condition/CheckTFTPonSN.pm b/xCAT-rmc/resources/mn/IBM.Condition/CheckTFTPonSN.pm new file mode 100644 index 000000000..b2aeff009 --- /dev/null +++ b/xCAT-rmc/resources/mn/IBM.Condition/CheckTFTPonSN.pm @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; + +my $proc="tftpd"; +if ($^O =~ /^linux/i) { + `rpm -q atftp-xcat`; + if ($?==0) { + $proc="atftpd"; + } +} + +$RES::Condition{'CheckTFTPonSN'} = { + Name => q(CheckTFTPonSN), + ResourceClass => q(IBM.Program), + EventExpression => q(Processes.CurPidCount == 0), + EventDescription => "An event will be generated when the TFTP server is down on the service node. There may be other nodes in this management domain such as HMCs. To exclude them, just change the SelectionString to: \"ProgramName=='$proc' && NodeNameList >< {'hmc1','hmc2}\" where hmc1 and hmc2 are the names for the nodes that you want to exclude.", + RearmExpression => q(Processes.CurPidCount != 0), + RearmDescription => q(A rearm event will be generated when the TFTP server is up on the service node.), + SelectionString => "ProgramName=='$proc'", + ManagementScope => q(4), + Severity => q(1), +}; +1;