[mrtg] MRTG delta value calculation problem

Oyvind Hallsteinsen Oyvind.Hallsteinsen at aitel.hist.no
Mon May 19 22:57:34 MEST 2003


I have problems with MRTG's calculation of delta values.

I call MRTG houerly from cron and my target is a script which gathers
pagecount-data from a printer. I run MRTG 2.9.29

It works most of the time, but some hours are graphed with the same
values as the previous, which is not correct. I know this is a "normal" 
condition - but I can't figure out what seems to be the problem.

If i check the logfile I can see that the values on the first line (with 
the current values) is correct, but the lines below are not correct. 
They are a copy of the values from the previous hour.

As far as I've understood, this condition is normal if:
- Values returned to MRTG are not understandable
- Target is unreachable/nothing is returned
- One/both values are over MaxBytes

None of these seem to be applicable to me, as you can see below. I can 
additionaly provide --debug values if that would help.

Any help would be greatly appreciated!




Example - studps.log
Values for 17:00:nn and 18:00:nn are correct. The 19:00:nn values are
incorrect - they are a copy of those from the run at 18:00:00.

The correct delta values for 19:00:nn are 170 and 85.

---[cut&edited from studps.log]----
1053363600 102 53 102 53 - 19:00:00
1053363300 102 53 102 53
1053363000 102 53 102 53
1053362700 102 53 102 53
1053362400 102 53 102 53
1053362100 102 53 102 53
1053361800 102 53 102 53
1053361500 102 53 102 53
1053361200 102 53 102 53
1053360900 102 53 102 53
1053360600 102 53 102 53
1053360300 102 53 102 53
1053360000 102 53 102 53 - 18:00:00
1053359700 102 53 102 53
1053359400 102 53 102 53
1053359100 102 53 102 53
1053358800 102 53 102 53
1053358500 102 53 102 53
1053358200 102 53 102 53
1053357900 102 53 102 53
1053357600 102 53 102 53
1053357300 102 53 102 53
1053357000 102 53 102 53
1053356700 102 53 222 111
1053356400 222 111 222 111 - 17:00:00
1053356100 222 111 222 111
---------------------------------

My script logs what it reports to MRTG.
Here is an edited summary:
-------
TIME, VALUE1 (DELTA1), VALUE2 (DELTA2)
17:00, 460208 (222), 248864 (111)
18:00, 460310 (102), 248917 (53)
19:00, 460480 (170), 249002 (85)
20:00, 460490 (10), 249007 (5)
--------


My Configuration:
----
# Global configuration
WorkDir: /my/original/directory/is/a/bit/revealing
Refresh: 600
Interval: 60
Language: Norwegian

# Studps
MaxBytes[studps]: 99999999
Options[studps]: growright, nopercent, perhour, noinfo, withzeroes
Target[studps]: `/usr/local/printstats/mrtg-studps`

Title[studps]: HIST AITeL - Utskriftsvolum: studps
PageTop[studps]: <h2>HIST AITEL - Utskriftsvolum: studps</h2>
YLegend[studps]: Antall per time
ShortLegend[studps]:&nbsp;
LegendI[studps]:sider:&nbsp;
LegendO[studps]:ark:&nbsp;
Legend1[studps]:Antall sider
Legend2[studps]:Antall ark
---


My script (yes, I know there's no errorchecking :-):
---
#!/bin/bash
WORKDIR=/usr/local/printstats
SYSNAME=domain.name.of.printer
SHORTNAME=`echo $SYSNAME|awk -F. '{print $1}'`
ANTSIDER=`snmpget $SYSNAME public 43.10.2.1.4.1.1|awk '{print $4}'`
ANTDUPLEX=`snmpget $SYSNAME public
.1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.2.22.0|awk '{print $3}'`
ANTARK=`dc -e "$ANTSIDER $ANTDUPLEX - p"`
UPTIME=1

# A log for our own part
echo `date '+%H:%M_%d-%m-%Y'`,$ANTSIDER,$ANTARK,$UPTIME,$SHORTNAME >>
$WORKDIR/logg-studps

# Send four lines of output to MRTG
echo $ANTSIDER
echo $ANTARK
echo $UPTIME
echo $SHORTNAME
---

--
Regards, Øyvind Hallsteinsen

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list