MRTG and/or rrdtool - one minute interval not working -
i testing mrtg 2.17.4 on ubuntu 16.04. configured use rrdtool log data. have "interval: 1" in /etc/mrtg.cfg. edited cron job @ /etc/cron.d/mrtg be:
*/1 * * * * root if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ] && [ -d "$(grep '^[[:space:]]*[^#]*[[:space:]]*workdir' /etc/mrtg.cfg | awk '{ print $nf }')" ]; mkdir -p /var/log/mrtg ; env lang=c /usr/bin/mrtg /etc/mrtg.cfg --debug="time,log" 2>&1 | tee -a /var/log/mrtg/mrtg.log ; fi
please note added debug option "time,log" troubleshoot. in /var/log/mrtg/mrtg.log, see data logged every 1 minute expected, not try calculate throughput every minute. instead, every 5 minutes. other times, says "got ???/???"
--time: prog start sat nov 12 21:54:01 2016 --time: loop start sat nov 12 21:54:01 2016 --time: snmp read start sat nov 12 21:54:01 2016 --time: target loop start sat nov 12 21:54:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479012841:171337092:172912456') --log: got: ???/??? --time: prog start sat nov 12 21:55:01 2016 --time: loop start sat nov 12 21:55:01 2016 --time: snmp read start sat nov 12 21:55:01 2016 --time: target loop start sat nov 12 21:55:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479012901:171686542:173262414') --log: got: 5804.75277777778/5813.21944444444 --time: prog start sat nov 12 21:56:02 2016 --time: loop start sat nov 12 21:56:02 2016 --time: snmp read start sat nov 12 21:56:02 2016 --time: target loop start sat nov 12 21:56:02 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479012962:172034542:173610922') --log: got: ???/??? --time: prog start sat nov 12 21:57:01 2016 --time: loop start sat nov 12 21:57:01 2016 --time: snmp read start sat nov 12 21:57:01 2016 --time: target loop start sat nov 12 21:57:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479013021:172376742:173953630') --log: got: ???/??? --time: prog start sat nov 12 21:58:01 2016 --time: loop start sat nov 12 21:58:01 2016 --time: snmp read start sat nov 12 21:58:01 2016 --time: target loop start sat nov 12 21:58:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479013081:172724742:174302138') --log: got: ???/??? --time: prog start sat nov 12 21:59:01 2016 --time: loop start sat nov 12 21:59:01 2016 --time: snmp read start sat nov 12 21:59:01 2016 --time: target loop start sat nov 12 21:59:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479013141:173077092:174654996') --log: got: ???/??? --time: prog start sat nov 12 22:00:02 2016 --time: loop start sat nov 12 22:00:02 2016 --time: snmp read start sat nov 12 22:00:02 2016 --time: target loop start sat nov 12 22:00:02 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479013202:173426542:175004954') --log: got: 5781.22263205829/5789.66200182149 --time: prog start sat nov 12 22:01:01 2016 --time: loop start sat nov 12 22:01:01 2016 --time: snmp read start sat nov 12 22:01:01 2016 --time: target loop start sat nov 12 22:01:01 2016 --log: rrds::tune(/var/mrtg/192.168.1.40_24.rrd -a ds0:125000000 -a ds1:125000000 -d ds0:counter -d ds1:counter) --log: rrds::update(/var/mrtg/192.168.1.40_24.rrd, '1479013261:173768742:175347662') --log: got: ???/???
i not particularly worried not calculate rate every minute need data stored in rrd database. when tried rrdtool fetch, still shows 5 minute data.. did wrong?
rrdtool fetch 192.168.1.40_24.rrd average -a -s -1h -r 1m -a ds0 ds1 1479010500: 1.0150000000e+04 1.0158466667e+04 1479010800: 1.0150000000e+04 1.0158466667e+04 1479011100: 1.0145166667e+04 1.0153661556e+04 1479011400: 1.0021447006e+04 1.0029884972e+04 1479011700: 5.8127796610e+03 5.8212468060e+03 1479012000: 5.7859754098e+03 5.7944147796e+03 1479012300: 5.8089454941e+03 5.8174389793e+03 1479012600: 5.8006990960e+03 5.8091662411e+03 1479012900: 5.8047527778e+03 5.8132194444e+03 1479013200: 5.7812226321e+03 5.7896620018e+03 1479013500: 5.7946912568e+03 5.8031847421e+03 1479013800: 5.8049794444e+03 5.8134465895e+03 1479014100: -nan -nan
thanks! difan
it might see mrtg config file, , output of rrdtool info
in rrd file.
however, cause created rrd file 5min interval, , changed 1min interval later. if this, mrtg not recreate rrd file, though change collecting data every 1min. mrtg able change maxbytes of rrd if modified after creation; other settings (rrdrowcount, interval) can used @ initial creation time, , subsequently changing them in mrtg cfg file not cause rrd file alter.
if use rrdtool info
on rrd file, see has 5min (300s) step size. way change delete rrd file (losing historical data) , allow mrtg re-create 60s interval specified in cfg file.
note that, if have lot of valuable historical data in 5min rrd file absolutely must keep, there third-party utilities available dump xml , recreate new rrd task bit complex. rrdmigrate
or rrdmerge
. latest rrdtool has abilities in area.
Comments
Post a Comment