[mrtg] Odd values from external script graph

Steve Shipway s.shipway at auckland.ac.nz
Thu Jan 29 04:10:57 CET 2015


Probably you are getting Data Normalisation (so many times I've posted about this now!) which is trying to fit your data into the Interval.  Run your test updates exactly on the time boundary -- eg, at exactly 12:00 and 12:05, not at 12:01 -- to make the effect minimal.  You can also set the 'integer' option in MRTG so that it only displayes integers even if the values come out as fractional.

For the maxytes, If you are using Routers2 as a frontend, then you can use the extended 'nomax' option to hide the MaxBytes line, else set it to something huge and make sure you do not have the 'unscaled' option set.

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
Ph: +64 9 373 7599 ext 86487

________________________________
From: mrtg [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Israel Brewster [israel at ravnalaska.net]
Sent: Thursday, 29 January 2015 7:44 a.m.
To: mrtg at lists.oetiker.ch
Subject: [mrtg] Odd values from external script graph

I'm sure I'm just missing a config directive somewhere, but I can't seem to figure out what. I have a MRTG graph I have set up to show query counts on my database. I reset the stats after each time I pull them, so I have the MRTG Options gauge directive specified. On a test database with no active users, I then ran twelve queries, and verified that the script I am running to get the data showed 12 as the output on the first line. However, when MRTG next ran, it showed a last value of only 4 rather than the 12 my script is returning. To make it even more odd, I've sometimes seen values of 1.6 or other non-integer numbers, even though my script only returns integer values. What am I missing? My config is shown below.

On a mostly unrelated note, is there any way to not have a MaxBytes directive? Since I am displaying a query count, it is essentially unlimited, although obviously I could just use some value that is so ridiculously high it is unlikely to ever be exceeded.

Thanks!

WorkDir: /var/www/mrtg
LogFormat: rrdtool
PathAdd: /usr/local/bin
Interval: 1

Target[fai-dbs1-flightlog-queries]: `/usr/local/bin/pg_stats.py <required arguments>`
Title[fai-dbs1-flightlog-queries]:fai-dbs1 FlightLogs Queries
PageTop[fai-dbs1-flightlog-queries]: <h1>fai-dbs1 FlightLogs Queries</h1>
Options[fai-dbs1-flightlog-queries]: integer growright gauge noi
MaxBytes[fai-dbs1-flightlog-queries]: 5000
LegendI[fai-dbs1-flightlog-queries]: 
LegendO[fai-dbs1-flightlog-queries]: Count:
Legend1[fai-dbs1-flightlog-queries]: 
Legend2[fai-dbs1-flightlog-queries]:Number of queries
YLegend[fai-dbs1-flightlog-queries]:count
-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/mrtg/attachments/20150129/106a4255/attachment.html>


More information about the mrtg mailing list