You should run cf-monitord and then simply use $(mon.loadavg) variables
(see ref manual)
Mark,
Maybe you can provide some insight on these vars. I actually did look
into using them first but could not interpret their values in a manner
that made them suitable as a replacement for standard load average as
derived from /proc/loadavg in Linux.
Here is the output of a cf-agent run with the system idle.
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.av_loadavg is 8.72
cf3 .........................................................
cf3
cf3 Reporting about this...
cf3 R: mon.av_loadavg is 8.72
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.dev_loadavg is 11.39
cf3 .........................................................
cf3
cf3 Reporting about this...
cf3 R: mon.dev_loadavg is 11.39
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.value_loadavg is 17
cf3 .........................................................
cf3
cf3 Reporting about this...
cf3 R: mon.value_loadavg is 17
I then simulated added load by running a couple of parallel "cat
/dev/zero > /dev/null"
Two metrics actually dropped, the third went up to 105.
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.av_loadavg is 6.04
cf3 .........................................................
cf3
cf3 Reporting about this...
cf3 R: mon.av_loadavg is 6.04
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.dev_loadavg is 9.51
cf3 .........................................................
cf3
cf3 Reporting about this...
cf3 R: mon.dev_loadavg is 9.51
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: mon.value_loadavg is 105
cf3 .........................................................
cf3
The manual (3.1.4) says the exact same thing for each var.
"Observational measure collected every 2.5 minutes from cf-monitord,
description: % kernel load utilization."
Thanks,
Frans
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine