Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
20274928
Commit
20274928
authored
Oct 15, 2018
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complain if there have been no updated to the RRD for an hour.
Also, allow percentages (-P) of greater than 100%.
parent
b1e15c87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
utils/cpuwatch.in
utils/cpuwatch.in
+9
-6
No files found.
utils/cpuwatch.in
View file @
20274928
...
...
@@ -178,11 +178,6 @@ if (defined($options{'L'})) {
if
(
defined
(
$options
{'
P
'}))
{
if
(
$options
{'
P
'}
=~
/^(\d+)$/
)
{
$loadpct
=
$
1
;
if
(
$loadpct
>
100
)
{
print
STDERR
"
Load percentage must be less than 100.
\n
";
usage
();
exit
(
1
);
}
}
else
{
print
STDERR
"
Load percentage must be a number.
\n
";
usage
();
...
...
@@ -262,7 +257,7 @@ openlog("cpuwatch", "pid", $TBLOG);
logit
("
cpuwatch starting:
");
logit
("
check=
${interval}
s, loadave=
"
.
sprintf
("
%.2f
",
$loadave
)
.
"
, loadpct=
${loadpct}
%, loadmin=
"
.
sprintf
("
%.2f
",
$load
ave
)
.
"
, loadpct=
${loadpct}
%, loadmin=
"
.
sprintf
("
%.2f
",
$load
min
)
.
"
, dothreads=
$dothreads
");
if
(
$sendmail
)
{
logit
("
mailmax=
$MAIL_MAX
messages
");
...
...
@@ -466,6 +461,14 @@ sub reportevents($)
foreach
my
$node
(
sort
keys
%pcs
)
{
if
(
!
$ref
->
{
$node
}{'
valid
'}
||
$ref
->
{
$node
}{'
tstamp
'}
==
$pcs
{
$node
}{'
lastcheck
'})
{
my
$now
=
time
();
# no slothd report for an hour, whine
if
(
$pcs
{
$node
}{'
lastcheck
'}
+
(
60
*
60
)
<=
$now
)
{
logit
("
$node
: WARNING: no slothd report since
"
.
POSIX::
strftime
("
20%y-%m-%d %H:%M:%S
",
$pcs
{
$node
}{'
lastcheck
'}));
}
next
;
}
$pcs
{
$node
}{'
lastcheck
'}
=
$ref
->
{
$node
}{'
tstamp
'};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment