[Xymon] CPU USAGE DISPLAY (CPU Statistics)
J.C. Cleaver
cleaver at terabithia.org
Wed Jul 30 00:52:22 CEST 2014
On Tue, July 29, 2014 9:05 am, Schwab, Jos wrote:
> Mark,
> Lastly, I also see in the man pages for TOP in the bugs section
> (again on CentOS) the TOP author speaks to this very topic. He
> calls the intervals samples. Here is that except:
>
> 7. BUGS
> Send bug reports to:
> Albert D. Cahalan, <albert at users.sf.net>
>
> The top command calculates Cpu(s) by looking at the change in CPU
> time values between samples. When
> you first run it, it has no previous sample to compare to, so
> these initial values are the percent-
> ages since boot. It means you need at least two loops or you have
> to ignore summary output from the
> first loop. This is problem for example for batch mode. There is a
> possible workaround if you define
> the CPULOOP=1 environment variable. The top command will be run one
> extra hidden loop for CPU data
> before standard output.
>
> _____________________________________________
> From: Schwab, Jos
> Sent: Tuesday, July 29, 2014 10:56 AM
> To: 'Mark Felder'
> Cc: 'xymon at xymon.com'
> Subject: RE: [Xymon] CPU USAGE DISPLAY (CPU Statistics)
>
>
> Mark,
> I failed to mention that in the man pages for TOP in CentOS 6.5,
> the -d command line option is called the interval which I had read
> somewhere is used to average statistics over. I hope that helps
> make it more clear and understandable.
Oof: https://bugzilla.redhat.com/show_bug.cgi?id=174619
Well, the system / idle / user etc percentages that end up getting graphed
in xymon are actually coming from the vmstat command, being run on
rotating 5 minute intervals, so the top output doesn't have an affect on
those graphs (or alerting, really). That being said, that's fairly
confusing, and it's a bit disappointing that procps doesn't call that out
a little bit better in its batch mode.
As a quick workaround, you can add CPULOOP=1 to the end of
/path/to/xymonclient.cfg and it should be in the environment for the $TOP
call in xymonclient-linux.sh. ($TOP gets a -x test against it, so the
command itself can't be modified to include env.)
That being said, this seems patch-worthy to at least give a more accurate
visual output. Wonder how non-Linux `top`'s deal with this...
HTH,
-jc
More information about the Xymon
mailing list