addind a sendor/condition to check the status of xcatd on the sn
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8191 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
86c033ce2c
commit
cacedba667
16
xCAT-rmc/resources/mn/IBM.Condition/CheckxCATonSN.pm
Normal file
16
xCAT-rmc/resources/mn/IBM.Condition/CheckxCATonSN.pm
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$RES::Condition{'CheckxCATonSN'} = {
|
||||
Name => q(CheckxCATonSN),
|
||||
ResourceClass => q(IBM.Sensor),
|
||||
EventExpression => q(String != "xcatd is ok"),
|
||||
EventDescription => q(An event will be generated when xcatd is not working.),
|
||||
RearmExpression => q(String == "xcatd is ok"),
|
||||
RearmDescription => q(An rearm event will be generated when xcatd resumes working state.),
|
||||
SelectionString => q(Name="CheckxCATSensor"),
|
||||
ManagementScope => q(4),
|
||||
Severity => q(1),
|
||||
};
|
||||
|
||||
|
||||
1;
|
19
xCAT-rmc/resources/mn/IBM.Sensor/CheckxCATSensor.pm
Normal file
19
xCAT-rmc/resources/mn/IBM.Sensor/CheckxCATSensor.pm
Normal 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_xcatd";
|
||||
|
||||
$RES::Sensor{'CheckxCATSensor'} = {
|
||||
Name => q(CheckxCATSensor),
|
||||
Command => "$cmd",
|
||||
Description => "This sensor monitors the xcatd daemon.",
|
||||
UserName => q(root),
|
||||
RefreshInterval => q(60),
|
||||
ErrorExitValue => q(1),
|
||||
ControlFlags => q(0),
|
||||
};
|
||||
1;
|
19
xCAT-rmc/resources/sn/IBM.Sensor/CheckxCATSensor.pm
Normal file
19
xCAT-rmc/resources/sn/IBM.Sensor/CheckxCATSensor.pm
Normal 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_xcatd";
|
||||
|
||||
$RES::Sensor{'CheckxCATSensor'} = {
|
||||
Name => q(CheckxCATSensor),
|
||||
Command => "$cmd",
|
||||
Description => "This sensor monitors the xcatd daemon.",
|
||||
UserName => q(root),
|
||||
RefreshInterval => q(60),
|
||||
ErrorExitValue => q(1),
|
||||
ControlFlags => q(0),
|
||||
};
|
||||
1;
|
22
xCAT-rmc/scripts/check_xcatd
Executable file
22
xCAT-rmc/scripts/check_xcatd
Executable 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=`$::XCATROOT/bin/lsxcatd -a 2>&1`;
|
||||
if ($?) {
|
||||
print "$rc";
|
||||
} else {
|
||||
print "xcatd is ok";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
Loading…
Reference in New Issue
Block a user