Commit 72f9f70c authored by Mike Hibler's avatar Mike Hibler

Minor tweaks.

parent 20274928
...@@ -298,7 +298,7 @@ sub getnodeinfo($) ...@@ -298,7 +298,7 @@ sub getnodeinfo($)
} }
$query_result = $query_result =
DBQueryWarn("select r.pid,r.eid,n.node_id,n.type,n.eventstate". DBQueryWarn("select r.pid,r.eid,n.node_id,n.type".
" from nodes as n,reserved as r,node_types as t". " from nodes as n,reserved as r,node_types as t".
" where n.node_id=r.node_id and n.role='testnode'". " where n.node_id=r.node_id and n.role='testnode'".
" and n.type=t.type and t.class='pc'". " and n.type=t.type and t.class='pc'".
...@@ -347,7 +347,6 @@ sub getnodeinfo($) ...@@ -347,7 +347,6 @@ sub getnodeinfo($)
$newpcs{$pc}{'expname'} = $expname; $newpcs{$pc}{'expname'} = $expname;
$newpcs{$pc}{'url'} = $url; $newpcs{$pc}{'url'} = $url;
$newpcs{$pc}{'portalurl'} = $portalurl; $newpcs{$pc}{'portalurl'} = $portalurl;
$newpcs{$pc}{'state'} = $row{'eventstate'};
$newpcs{$pc}{'type'} = $row{'type'}; $newpcs{$pc}{'type'} = $row{'type'};
if (!exists($pcs{$pc})) { if (!exists($pcs{$pc})) {
...@@ -459,20 +458,24 @@ sub reportevents($) ...@@ -459,20 +458,24 @@ sub reportevents($)
my $warned = 0; my $warned = 0;
foreach my $node (sort keys %pcs) { foreach my $node (sort keys %pcs) {
if (!$ref->{$node}{'valid'} || my $lcheck = $pcs{$node}{'lastcheck'};
$ref->{$node}{'tstamp'} == $pcs{$node}{'lastcheck'}) { if ($lcheck !~ /\d+/) {
logit("$node: WARNING: bogus lastcheck '$lcheck' ignored");
}
if (!$ref->{$node}{'valid'} || $ref->{$node}{'tstamp'} == $lcheck) {
my $now = time(); my $now = time();
# no slothd report for an hour, whine # no slothd report for an hour, whine
if ($pcs{$node}{'lastcheck'} + (60 * 60) <= $now) { if ($lcheck + (60 * 60) <= $now) {
logit("$node: WARNING: no slothd report since ". logit("$node: WARNING: no slothd report since ".
POSIX::strftime("20%y-%m-%d %H:%M:%S", POSIX::strftime("20%y-%m-%d %H:%M:%S",
$pcs{$node}{'lastcheck'})); localtime($lcheck)));
} }
next; next;
} }
$pcs{$node}{'lastcheck'} = $ref->{$node}{'tstamp'}; if ($ref->{$node}{'valid'}) {
$pcs{$node}{'lastcheck'} = $ref->{$node}{'tstamp'};
}
my ($loadiv, $curload); my ($loadiv, $curload);
if ($interval < (5*60)) { if ($interval < (5*60)) {
$curload = $ref->{$node}{'lave1'}; $curload = $ref->{$node}{'lave1'};
......
Markdown is supported
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