Excellent! Thanks. One more reason to upgrade. But this will save me LOTS of time.<br>Thanks Henrik.<br>Steve<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 12:08 PM, Henrik Størner <span dir="ltr"><<a href="mailto:henrik@hswn.dk">henrik@hswn.dk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11-01-2012 17:43, Steve Holmes wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I know this isn't really what Xymon is designed to do, but I've been<br>
asked to produce data for a text based report of usage (cpu, memory, and<br>
disk weekly averages (which I've yet to convince them might not make<br>
sense)) from Xymon history or rrd data for management. The requester<br>
will put the data I provide into a spreadsheet.<br>
<br>
Before I go re-inventing the wheel I'm wondering if anyone has done<br>
something like this already.<br>
</blockquote>
<br></div>
perfdata.cgi - ships with Xymon 4.3.x. Dumps all of the data in the RRD files to a comma-separated file (CSV) that you can import into Excel for further processing.<br>
<br>
Hmm, I see it isn't documented. Anyway, I do the extract once a month with this script:<br>
<br>
<br>
#!/bin/sh<br>
<br>
START=`date '+%Y%m01' --date="1 month ago"`<br>
END=`date '+%Y%m01'`<br>
<br>
xymoncmd perfdata.cgi $START $END 2>/dev/null | \<br>
   gzip >~ftp/perfmonthly/data-$END.gz<br>
<br>
<br>
If you only want to export data from a particular group of Xymon servers, perfdata.cgi takes a "--page=REGEXP" option to only extract data for hosts that appear on a page matching REGEXP (a regular expression). But it is surprisingly fast to export data from even a very large number of hosts.<br>


<br>
There's also a "--csv=CHAR" option, in case your local Excel version uses another character than comma as the delimiter in CSV-files (around here, we use semi-colon...)<br>
<br>
Here's an example of the data:<br>
<br>
"hostname";"datasource";"<u></u>rrdcolumn";"measurement";"<u></u>time";"value"<br>
"myserver01";"la.rrd";"la";"<u></u>pctbusy";"20111201010000";2.<u></u>753750<br>
"myserver01";"la.rrd";"la";"<u></u>pctbusy";"20111201030000";2.<u></u>359861<br>
"myserver01";"la.rrd";"la";"<u></u>pctbusy";"20111201050000";3.<u></u>428056<br>
"myserver01";"la.rrd";"la";"<u></u>pctbusy";"20111201070000";2.<u></u>363194<br>
"myserver01";"la.rrd";"la";"<u></u>pctbusy";"20111201090000";3.<u></u>246250<br>
<br>
As you can see, it is a rather raw export of the RRD data with a timestamp on RRD datapoint - it doesn't do any aggregation/averaging over the past week. You'll have to do that yourself in Excel.<br>
<br>
"pctbusy" means the "percent CPU busy". For Unix-systems, perfdata.cgi pulls data from the "vmstat" data, so you will also get a "percent busy" reading for those systems - not a "load average".<br>


<br>
There are some other data items:<br>
<br>
"myserver01";"memory.actual.<u></u>rrd";"realmempct";"Virtual";"<u></u>20111201010000";0.000000<br>
"myserver01";"memory.real.rrd"<u></u>;"realmempct";"RAM";"<u></u>20111201010000";49.708333<br>
"myserver01";"memory.swap.rrd"<u></u>;"realmempct";"Swap";"<u></u>20111201010000";23.416667<br>
<br>
"Virtual", "RAM" and "Swap" correspond to the data-items you'll see on the "Memory" status in Xymon.<br>
<br>
"myserver01";"disk,C.rrd";"<u></u>pct";"/C";"20111201010000";77.<u></u>000000<br>
<br>
How full a disk is.<br>
<br>
<br>
Note that since this pulls data directly from the RRD files, the granularity of the data depends on how old they are. If you pull data from the past week, you'll get 5-minute or 30-minute readings; if you pull data more than 48 days old, you'll only get 1-day averages.<br>


<br>
<br>
Regards,<br>
Henrik<br>
______________________________<u></u>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/<u></u>mailman/listinfo/xymon</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><span style="font-size:13px;background-color:rgb(255,255,255)">If they give you ruled paper, write the other way. -Juan Ramon Jimenez, poet, Nobel Prize in literature (1881-1958) </span><br>

</span></font><br>Truth never damages a cause that is just. -Mohandas Karamchand Gandhi (1869-1948) </div><br>