Discussion:
mrtg logfile not rotating
(too old to reply)
s***@wondrusch.com
2008-03-05 09:43:11 UTC
Permalink
Hi all

I have a strange problem. It seems that mrtg is able to get the
current values and loging them to the first line of the logfile. But
2nd and following lines stay always zero. My chart is a zero-line,
also the written value "Current" is always zero.

The setup: The device I'm polling is an Amperemeter (APC PDU AP7953).
The snmp value is not a counter. 4,3A give a snmp value of 43. I did
let it run for a long time and it did not change behaviour.

What could be the reason, that the values are not processed to the
following lines?

thx & rgds Stiwi


Configurationfile:
xxxxxxxxxxxxxxxxxx

#/etc/mrtg/san # cat wot2.cfg

#IconDir: /ussweb/docs/mrtg/html
WriteExpires: Yes
Refresh: 300
WorkDir: /var/log/sysman/mrtg
#
#-------------------------------------------------------------------------------
#-- Global Defaults
#-------------------------------------------------------------------------------
#
Options[_]: growright, gauge, nopercent
MaxBytes[_]: 150
Legend1[_]: Bank B1 Load
Legend2[_]: Bank B2 Load
LegendI[_]: Bank B1 Load
LegendO[_]: Bank B2 Load
YLegend[_]: mWatt
ShortLegend[_]: [mW]
WithPeak[_]: ywm
EnableIPv6: no
#
#-----------------------------------
apcpdu01a-----------------------------------------
#Bank1 Bank2
Target[wot2_b1b2]:
1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1&1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.2:***@wot2
* 100
Title[wot2_b1b2]: Rack 15 APC PDU elektrisch Leistung
PageTop[wot2_b1b2]: <H1>APC PDU apcpdu01a Bank1 / Bank2 elektrische
Leistung</H1>
#
#

snmpget output:
xxxxxxxxxxxxxxxx

/var/log/sysman/mrtg # snmpget -c public -v1 wot2
1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1
SNMPv2-SMI::enterprises.318.1.1.12.2.3.1.1.2.1 = Gauge32: 79
/var/log/sysman/mrtg # snmpget -c public -v1 wot2
1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.2
SNMPv2-SMI::enterprises.318.1.1.12.2.3.1.1.2.2 = Gauge32: 43


logfile:
xxxxxxxx

/var/log/sysman/mrtg # date ;ls -l wot2_b1b2.log ; head -10
wot2_b1b2.log
Wed Mar 5 10:20:13 CET 2008
-rw-r--r-- 1 root root 48205 Mar 5 10:20 wot2_b1b2.log
1204708801 7900 4300
1204708801 0 0 0 0
1204708501 0 0 0 0
1204708500 0 0 0 0
1204708200 0 0 0 0
1204707900 0 0 0 0
1204707600 0 0 0 0
1204707300 0 0 0 0
1204707000 0 0 0 0
1204706700 0 0 0 0

logfile 5 Min later with higher B2 Current:
xxxxxxxxxxxxxxxxxxxxxx

/var/log/sysman/mrtg # date ;ls -l wot2_b1b2.log ; head -10
wot2_b1b2.log
Wed Mar 5 10:25:15 CET 2008
-rw-r--r-- 1 root root 48205 Mar 5 10:25 wot2_b1b2.log
1204709101 7900 8300
1204709101 0 0 0 0
1204708801 0 0 0 0
1204708800 0 0 0 0
1204708500 0 0 0 0
1204708200 0 0 0 0
1204707900 0 0 0 0
1204707600 0 0 0 0
1204707300 0 0 0 0
1204707000 0 0 0 0


Error logfile:
xxxxxxxxxxxxxxxx

/var/log/sysman/mrtg # tail /var/log/sysman/mrtg/log/wot2.mrtg1.log
2008-03-05 09:40:01 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 09:45:02 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 09:50:02 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 09:55:02 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 09:55:10 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 10:00:02 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 10:05:02 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 10:10:01 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 10:15:01 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'
2008-03-05 10:20:01 -- Started mrtg with config '/etc/mrtg/san/
wot2.cfg'

crontab:
xxxxxxxxxxx

/var/log/sysman/mrtg # cat /etc/cron.d/mrtg_wot2
#-# generated configuration / to change, use the scripts from /opt/
sysman/bin/install #-#
*/5 * * * * root test -x /usr/bin/mrtg && /usr/bin/mrtg /etc/
mrtg/san/wot2.cfg --logging /var/log/sysman/mrtg/log/wot2.mrtg1.log > /
dev/null 2>&1
s***@wondrusch.com
2008-03-05 20:12:44 UTC
Permalink
figured it out myself

MaxBytes was to small. It has to be bigger than the numbers loged in
the logfile

I changed it to:
MaxBytes[_]: 15000

Loading...