Commit 773256c3 authored by Dan Reading's avatar Dan Reading
Browse files

add saving testbed DB format for hw capture

parent 9457013f
......@@ -36,7 +36,11 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
system("echo 'Running nodechecks'");
$host = `hostname`;
if ( -r '/var/emulab/boot/realname' ) {
$host = `cat /var/emulab/boot/realname`;
}
print "from startup host:$host\n";
if (!$ARGV[0]) {
$action = "noboot";
} else
......@@ -47,12 +51,16 @@ if (!$ARGV[0]) {
# truncate file at boot time
if ($action eq "boot") {
system("echo 'Start boot_time_node_check' > /var/emulab/logs/nodecheck.log");
system("cp /dev/null /var/emulab/logs/nodecheck.log.tb");
}
foreach my $i (@checkscripts) {
system("bash /usr/local/etc/emulab/${i}check /var/emulab/logs/nodecheck.log");
}
if ($action eq "boot") {
system("echo 'Finish boot_time_node_check' >> /var/emulab/logs/nodecheck.log");
system("echo '-- Finish boot_time_node_check --' >> /var/emulab/logs/nodecheck.log");
if ( -e "/var/emulab/logs/nodecheck.log.tb" ) {
system("cp /var/emulab/logs/nodecheck.log.tb /proj/emulab-ops/nodecheck/$host");
}
}
system("echo 'Done with nodechecks'");
......
......@@ -20,7 +20,7 @@ fi
host=`hostname`
if [ -e "/var/emulab/boot/realname" ]; then
host=`cat /var/emulab/boot/realname`
host=$(cat /var/emulab/boot/realname)
fi
checks="disk cpu mem time nic diskspeed"
......@@ -28,14 +28,19 @@ checks="disk cpu mem time nic diskspeed"
echo "Running nodechecks"
# truncate file at boot time
if [ "$1" = "boot" ] ; then
$(echo "Start boot_time_node_check" > /var/emulab/logs/nodecheck.log)
$(echo "-- Start boot_time_node_check --" > /var/emulab/logs/nodecheck.log)
$(cp /dev/null /var/emulab/logs/nodecheck.log.tb)
fi
for i in $checks
do
/usr/local/bin/bash /usr/local/etc/emulab/${i}check /var/emulab/logs/nodecheck.log
/usr/local/bin/bash /usr/local/etc/emulab/${i}check /var/emulab/logs/nodecheck.log /var/emulab/logs/nodecheck.log.tb
done
if [ "$1" = "boot" ] ; then
$(echo "Finish boot_time_node_check" >> /var/emulab/logs/nodecheck.log)
$(echo "-- Finish boot_time_node_check --" >> /var/emulab/logs/nodecheck.log)
if [ -e /var/emulab/logs/nodecheck.log.tb ] ; then
cp /var/emulab/logs/nodecheck.log.tb /proj/emulab-ops/nodecheck/$host
fi
fi
echo "Done with nodechecks"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment