more code to make sure 3rd party can add RMC resources easily
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8442 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
f0582473ab
commit
147d0f8045
17
xCAT-rmc/resources/sn/IBM.Sensor/ErrorLogSensor.pm
Normal file
17
xCAT-rmc/resources/sn/IBM.Sensor/ErrorLogSensor.pm
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
my $cmd;
|
||||
if (-r "/var/xcat/rmcmon/scripts/monerrorlog") {
|
||||
$cmd="/var/xcat/rmcmon/scripts/monerrorlog";
|
||||
} else {
|
||||
$cmd="/opt/xcat/sbin/rmcmon/monerrorlog";
|
||||
}
|
||||
|
||||
$RES::Sensor{'ErrorLogSensor'} = {
|
||||
Name => q(ErrorLogSensor),
|
||||
Command => "$cmd",
|
||||
UserName => q(root),
|
||||
RefreshInterval => q(60),
|
||||
ControlFlags => q(4),
|
||||
};
|
||||
1;
|
@ -174,17 +174,27 @@ if [ $ADD -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
#create predefined sensors
|
||||
#create predefined resources
|
||||
if [[ -z "$NFSSERVER" ]]; then
|
||||
NFSSERVER=$MASTER
|
||||
fi
|
||||
|
||||
nodetype="node"
|
||||
if [[ $NTYPE = service ]]; then
|
||||
nodetype=sn
|
||||
fi
|
||||
|
||||
mkdir -p /var/xcat/rmcmon
|
||||
rm -f -R /var/xcat/rmcmon
|
||||
if [[ $OSTYPE = linux* ]]; then
|
||||
mkdir -p /tmp/postage/rmcmon
|
||||
rm -f -R /tmp/postage/rmcmon/*
|
||||
cd /tmp/postage/rmcmon
|
||||
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$NFSSERVER/postscripts/rmcmon 2> /tmp/wget.log
|
||||
mkdir -p /tmp/postage/rmcmon/scripts
|
||||
mkdir -p /tmp/postage/rmcmon/resources/$nodetype
|
||||
rm -f -R /tmp/postage/rmcmon/scripts/*
|
||||
rm -f -R /tmp/postage/rmcmon/resources/$nodetype
|
||||
cd /tmp/postage/rmcmon/scripts
|
||||
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$NFSSERVER/postscripts/rmcmon/scripts 2> /tmp/wget.log
|
||||
cd /tmp/postage/rmcmon/resources/$nodetype
|
||||
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$NFSSERVER/postscripts/rmcmon/resources/$nodetyp 2> /tmp/wget.log
|
||||
mv $NFSSERVER/postscripts/rmcmon /var/xcat/rmcmon;
|
||||
rm -rf $NFSSERVER
|
||||
else
|
||||
@ -195,12 +205,15 @@ if [ $ADD -eq 1 ]; then
|
||||
logger -t xCAT "Failed to mount $result"
|
||||
exit 1
|
||||
fi
|
||||
cp -p -R /xcatmnt/rmcmon /var/xcat/rmcmon 2>/dev/null
|
||||
mkdir -p /var/xcat/rmcmon/scripts
|
||||
cp -p -R /xcatmnt/rmcmon/scripts /var/xcat/rmcmon/scripts 2>/dev/null
|
||||
mkdir -p /var/xcat/rmcmon/resources/$nodetype
|
||||
cp -p -R /xcatmnt/rmcmon/resources/$nodetype /var/xcat/rmcmon/resources/$nodetype 2>/dev/null
|
||||
umount /xcatmnt
|
||||
rmdir /xcatmnt
|
||||
fi
|
||||
chmod 755 /var/xcat/rmcmon/scripts/*
|
||||
/var/xcat/rmcmon/scripts/mkrmcresources /var/xcat/rmcmon/resources
|
||||
/var/xcat/rmcmon/scripts/mkrmcresources /var/xcat/rmcmon/resources/$nodetype
|
||||
else
|
||||
#check if the resource is defined
|
||||
result=`/usr/bin/lsrsrc-api -s IBM.MCP::"NodeID=0x$MS_NODEID"::MNName 2>&1`
|
||||
|
@ -33,7 +33,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/rmc
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon
|
||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts
|
||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts/rmcmon/resources
|
||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts/rmcmon/resources/node
|
||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts/rmcmon/scripts
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
|
||||
|
||||
@ -60,7 +60,7 @@ do
|
||||
done
|
||||
chmod 755 $RPM_BUILD_ROOT/install/postscripts/rmcmon/scripts/*
|
||||
|
||||
cp -r resources/node/* $RPM_BUILD_ROOT/install/postscripts/rmcmon/resources
|
||||
cp -r resources/node/* $RPM_BUILD_ROOT/install/postscripts/rmcmon/resources/node
|
||||
|
||||
|
||||
%clean
|
||||
|
Loading…
Reference in New Issue
Block a user