more conditions for monitoring services on the sn

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8233 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2010-11-22 18:08:17 +00:00
parent faaeb1caea
commit 47dbfbd439
5 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/perl
$RES::Condition{'CheckFTPonSN_AIX'} = {
Name => q(CheckFTPonSN_AIX),
ResourceClass => q(IBM.Sensor),
EventExpression => q(String != "ftpd is active"),
EventDescription => q(For AIX only. An event will be generated when the FTP 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=='vsftpd' && NodeNameList >< {'hmc1','hmc2}" where hmc1 and hmc2 are the names for the nodes that you want to exclude.),
RearmExpression => q(String == "ftpd is active"),
RearmDescription => q(A rearm event will be generated when the FTP server is up on the service node.),
SelectionString => q(Name="CheckFTPSensor_AIX"),
ManagementScope => q(4),
Severity => q(1),
};
1;

View File

@ -0,0 +1,14 @@
#!/usr/bin/perl
$RES::Condition{'CheckNFSonSN'} = {
Name => q(CheckNFSonSN),
ResourceClass => q(IBM.Program),
EventExpression => q(Processes.CurPidCount == 0),
EventDescription => q(An event will be generated when the NFS 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=='nfsd' && 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 NFS server is up on the service node.),
SelectionString => q(ProgramName=='nfsd'),
ManagementScope => q(4),
Severity => q(1),
};
1;

View File

@ -0,0 +1,19 @@
#!/usr/bin/perl
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
my $cmd="$::XCATROOT/sbin/rmcmon/check_ftpd";
$RES::Sensor{'CheckFTPSensor_AIX'} = {
Name => q(CheckFTPSensor_AIX),
Command => "$cmd",
Description => "This sensor monitors the FTP server on AIX.",
UserName => q(root),
RefreshInterval => q(60),
ErrorExitValue => q(1),
ControlFlags => q(1),
};
1;

View File

@ -0,0 +1,19 @@
#!/usr/bin/perl
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
my $cmd="$::XCATROOT/sbin/rmcmon/check_ftpd";
$RES::Sensor{'CheckFTPSensor_AIX'} = {
Name => q(CheckFTPSensor_AIX),
Command => "$cmd",
Description => "This sensor monitors the FTP server on AIX.",
UserName => q(root),
RefreshInterval => q(60),
ErrorExitValue => q(1),
ControlFlags => q(1),
};
1;

22
xCAT-rmc/scripts/check_ftpd Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env perl
# IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html
use strict;
use locale;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use Getopt::Std;
use IPC::SysV qw(IPC_STAT S_IRWXU IPC_PRIVATE IPC_CREAT S_IRUSR S_IWUSR );
use IPC::Msg;
my $rc=`lssrc -l -s inetd |grep " ftpd"|grep active 2>&1`;
if ($? == 0) {
print "ftpd is active";
} else {
print "ftpd is inoperative"
}
exit 0;