FAQ
Hi!


I have a problem with an snmp based network plugin. It is very simple, it
reads the traffic counter from the ifHC table and produces a graph
accordingly.
My problem is when I restart snmpd, it resets the counters, and this produces
a *very* high peak in the graphs (eg. 16 Petabytes), and it breaks the max
and average values on the graphs. This only happens for the one read right
after the restart, so it is just a slim line on the graph, but nevertheless
it borks the graph.
Is there a known workaround or solution for this?

ps.: I'll gladly post the plugin here if it is needed, but it is really
simple, it is really just a snmpget with some garnishing.

Thanks for any advice!

Daniel

--
LÉVAI Dániel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1

Search Discussions

  • Nicolai Langfeldt at Nov 23, 2009 at 12:45 pm

    LEVAI Daniel wrote:
    I have a problem with an snmp based network plugin. It is very simple, it
    reads the traffic counter from the ifHC table and produces a graph
    accordingly.
    My problem is when I restart snmpd, it resets the counters, and this produces
    a *very* high peak in the graphs (eg. 16 Petabytes), and it breaks the max
    and average values on the graphs. This only happens for the one read right
    after the restart, so it is just a slim line on the graph, but nevertheless
    it borks the graph.
    Is there a known workaround or solution for this?

    ps.: I'll gladly post the plugin here if it is needed, but it is really
    simple, it is really just a snmpget with some garnishing.
    First consider this:
    http://munin.projects.linpro.no/wiki/HowToWritePlugins#DERIVEvs.COUNTER

    But it sounds like you're duplicating this:
    http://munin.projects.linpro.no/browser/trunk/plugins/node.d/snmp__if_.in
    (included like that in 1.3 series and soon to come 1.4.0), so looking at
    it may help. I guess the .max is needed to avoid positive spikes.

    Nicolai
  • LEVAI Daniel at Nov 24, 2009 at 10:30 am

    On Monday 23 November 2009 13.27.42 you wrote:
    LEVAI Daniel wrote:
    [...]
    My problem is when I restart snmpd, it resets the counters, and this
    produces a *very* high peak in the graphs (eg. 16 Petabytes), and it
    [...]
    First consider this:
    http://munin.projects.linpro.no/wiki/HowToWritePlugins#DERIVEvs.COUNTER

    But it sounds like you're duplicating this:
    http://munin.projects.linpro.no/browser/trunk/plugins/node.d/snmp__if_.in
    (included like that in 1.3 series and soon to come 1.4.0), so looking at
    it may help. I guess the .max is needed to avoid positive spikes.
    Thanks for the pointers! It really helped!


    Daniel

    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1
  • Maciej Wierzbicki at Nov 24, 2009 at 1:29 pm

    LEVAI Daniel wrote on 2009-11-23 13:10:

    My problem is when I restart snmpd, it resets the counters, and this produces
    a *very* high peak in the graphs (eg. 16 Petabytes), and it breaks the max
    and average values on the graphs. This only happens for the one read right
    after the restart, so it is just a slim line on the graph, but nevertheless
    it borks the graph.
    Is there a known workaround or solution for this?
    Nicolai wrote excellent suggestions, but I have another one.

    There is a workaround, which I use to remove unneeded peaks from various
    rrd data, which happens to me occasionaly from time to time after
    various restarts, for example interface counters/traffic after server
    restart. Basicaly I extract rrd data to xml and then fix the peak using
    perl (you may need other value to be fixed than in my script). I think I
    found similar script somewhere over Internet and adapted it to my
    purpose. Remember to backup the *.rrd files before you do that. ;-)

    #!/bin/sh

    for i in `ls *.rrd`; do
    mv $i ${i}.bak
    rrdtool dump ${i}.bak | perl -pe 's/(.*) \d\.\d+e\+1\d
    (<\/v>.*)/$1 0.0000000000e+00 $2/' > ${i}.xml
    rrdtool restore ${i}.xml ${i}
    done

    --
    * Maciej Wierzbicki * At paranoia's poison door *
    * VOO1-RIPE *
  • Steve Schnepp at Nov 24, 2009 at 2:04 pm
    2009/11/24 Maciej Wierzbicki <[email protected]>
    Nicolai wrote excellent suggestions, but I have another one.

    restart. Basicaly I extract rrd data to xml and then fix the peak using
    perl (you may need other value to be fixed than in my script). I think I
    Actually, you don't even need to parse the xml data with Perl. Just modify
    directly the rrds files with rrdtune and dump/restore the data. rrdrestore
    will wipe out the erroneous data. Something like :

    rrdtool tune ${RRD_FILE} --maximum 42:${MAXIMUM_VALUE}
    (rrdtool dump ${RRD_FILE} | rrdtool restore --range-check - ${RRD_FILE}.new)
    && \
    mv ${RRD_FILE} ${RRD_FILE}.bak && \
    mv ${RRD_FILE}.new ${RRD_FILE}
    # Optionally remove the maximum
    rrdtool tune ${RRD_FILE} --maximum 42:U
  • LEVAI Daniel at Nov 25, 2009 at 10:15 am

    On Tuesday 24 November 2009 15.04.25 Steve Schnepp wrote:
    2009/11/24 Maciej Wierzbicki <[email protected]>
    Nicolai wrote excellent suggestions, but I have another one.

    restart. Basicaly I extract rrd data to xml and then fix the peak using
    perl (you may need other value to be fixed than in my script). I think I
    Actually, you don't even need to parse the xml data with Perl. Just modify
    directly the rrds files with rrdtune and dump/restore the data. rrdrestore
    will wipe out the erroneous data. Something like :

    rrdtool tune ${RRD_FILE} --maximum 42:${MAXIMUM_VALUE}
    (rrdtool dump ${RRD_FILE} | rrdtool restore --range-check -
    ${RRD_FILE}.new) && \
    mv ${RRD_FILE} ${RRD_FILE}.bak && \
    mv ${RRD_FILE}.new ${RRD_FILE}
    # Optionally remove the maximum
    rrdtool tune ${RRD_FILE} --maximum 42:U
    Wow, Maciej and Steve, great ideas, thanks a lot!


    Daniel

    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1
  • LEVAI Daniel at Nov 25, 2009 at 2:31 pm

    On Tuesday 24 November 2009 14.29.26 Maciej Wierzbicki wrote:
    LEVAI Daniel wrote on 2009-11-23 13:10:
    My problem is when I restart snmpd, it resets the counters, and this
    produces a *very* high peak in the graphs (eg. 16 Petabytes), and it
    breaks the max and average values on the graphs. This only happens for
    the one read right after the restart, so it is just a slim line on the
    graph, but nevertheless it borks the graph.
    Is there a known workaround or solution for this?
    Nicolai wrote excellent suggestions, but I have another one.
    [...]

    WRT to Nicolai's suggestion:

    My ${name}.min configuration option doesn't seem to work :\

    My script produces this for config == $1:
    echo 'graph_order in out'
    echo "graph_title eth0 traffic (ifHC)"
    echo "graph_args --base 1000 --lower-limit 0 --units-exponent 6 \
    --upper-limit 1000000000 --rigid"
    echo 'graph_vlabel bits in/out per ${graph_period}'
    echo 'graph_category network'
    echo 'in.label in'
    echo 'in.type DERIVE'
    echo 'in.min 0'
    echo 'in.cdef in,8,*'
    echo 'in.draw AREA'
    echo 'out.label out'
    echo 'out.type DERIVE'
    echo 'out.min 0'
    echo 'out.cdef out,8,*'
    echo 'out.draw LINE1'

    Is there any catch regarding the use of the .min value? When I restart snmpd
    now, I get -20,-30Gb values on the graphs, despite of the .min option. This
    is a way smaller value than before with the COUNTER type, I admit, but still,
    it would be nice eliminate this negative value :)

    Thanks in advance,

    Daniel


    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1
  • Nicolai Langfeldt at Nov 25, 2009 at 7:56 pm

    LEVAI Daniel wrote:
    WRT to Nicolai's suggestion:

    My ${name}.min configuration option doesn't seem to work :\

    My script produces this for config == $1:
    echo 'graph_order in out'
    echo "graph_title eth0 traffic (ifHC)"
    echo "graph_args --base 1000 --lower-limit 0 --units-exponent 6 \
    --upper-limit 1000000000 --rigid"
    echo 'graph_vlabel bits in/out per ${graph_period}'
    echo 'graph_category network'
    echo 'in.label in'
    echo 'in.type DERIVE'
    echo 'in.min 0'
    echo 'in.cdef in,8,*'
    echo 'in.draw AREA'
    echo 'out.label out'
    echo 'out.type DERIVE'
    echo 'out.min 0'
    echo 'out.cdef out,8,*'
    echo 'out.draw LINE1'

    Is there any catch regarding the use of the .min value? When I restart snmpd
    now, I get -20,-30Gb values on the graphs, despite of the .min option. This
    is a way smaller value than before with the COUNTER type, I admit, but still,
    it would be nice eliminate this negative value :)
    You may be bumping into a problem that has been reported once
    previously: somehow some rrd files does not get re-tuned properly when
    the min/max settings are changed.

    Can you please run "rrdtool tune" on all of the rrd files created by the
    plugin and see if the min settings are according to the plugin?

    If they're not there was a posting earlier today about retuning and
    "normalizing" the rrd file by export/import.

    I'd also like to know if they're not.

    Nicolai
  • LEVAI Daniel at Nov 26, 2009 at 9:53 am

    On Wednesday 25 November 2009 20.56.06 you wrote:
    LEVAI Daniel wrote:
    WRT to Nicolai's suggestion:

    My ${name}.min configuration option doesn't seem to work :\
    [...]
    echo 'in.min 0'
    [...]
    echo 'out.min 0'
    [...]
    You may be bumping into a problem that has been reported once
    previously: somehow some rrd files does not get re-tuned properly when
    the min/max settings are changed.
    You're right! This was exactly my problem.
    Can you please run "rrdtool tune" on all of the rrd files created by the
    plugin and see if the min settings are according to the plugin?
    The min settings were all 'nan'.
    If they're not there was a posting earlier today about retuning and
    "normalizing" the rrd file by export/import.
    Those advices worked like charm, now I'm not just protected from future peaks,
    but the past peaks got removed from the graphs too.

    Thanks again for the great support!


    Daniel

    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1
  • Nicolai Langfeldt at Nov 26, 2009 at 10:03 am

    LEVAI Daniel wrote:
    Can you please run "rrdtool tune" on all of the rrd files created by the
    plugin and see if the min settings are according to the plugin?
    The min settings were all 'nan'.
    Bummer. What version of munin are you running?
    If they're not there was a posting earlier today about retuning and
    "normalizing" the rrd file by export/import.
    Those advices worked like charm, now I'm not just protected from future peaks,
    but the past peaks got removed from the graphs too.
    It would be very appreciated if someone entered this, including how to
    fix the rrd files, in the FAQ on the wiki.

    Thanks,
    Nicolai
  • Steve Schnepp at Nov 26, 2009 at 10:25 am
    2009/11/26 Nicolai Langfeldt <[email protected]>
    It would be very appreciated if someone entered this, including how to
    fix the rrd files, in the FAQ on the wiki.
    Just did it.
    http://munin-monitoring.org/wiki/faq#Q:Ieditedmyplugintohaveminmaxvaluesbuttheyarenottakeninaccount

    Strange i have the ACL to submit changes but not preview them :-)

    --
    Steve Schnepp
    http://blog.pwkf.org/
  • Nicolai Langfeldt at Nov 26, 2009 at 10:30 am

    Steve Schnepp wrote:

    2009/11/26 Nicolai Langfeldt <[email protected]

    It would be very appreciated if someone entered this, including how to
    fix the rrd files, in the FAQ on the wiki.


    Just did it.
    http://munin-monitoring.org/wiki/faq#Q:Ieditedmyplugintohaveminmaxvaluesbuttheyarenottakeninaccount

    Strange i have the ACL to submit changes but not preview them :-)
    thanks a lot :-)

    Nicolai
  • LEVAI Daniel at Nov 26, 2009 at 10:48 am

    On Thursday 26 November 2009 11.02.56 Nicolai Langfeldt wrote:
    LEVAI Daniel wrote:
    Can you please run "rrdtool tune" on all of the rrd files created by the
    plugin and see if the min settings are according to the plugin?
    The min settings were all 'nan'.
    Bummer. What version of munin are you running?
    munin 1.2.6 from Debian lenny. Maybe there will be munin-1.4 package after its
    release on backports in the near future.
    If they're not there was a posting earlier today about retuning and
    "normalizing" the rrd file by export/import.
    Those advices worked like charm, now I'm not just protected from future
    peaks, but the past peaks got removed from the graphs too.
    It would be very appreciated if someone entered this, including how to
    fix the rrd files, in the FAQ on the wiki.
    On Thursday 26 November 2009 11.24.43 Steve Schnepp wrote:
    Just did it.
    Thanks!


    Daniel

    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1
  • Steve Schnepp at Nov 30, 2009 at 5:05 pm
    Btw, I just discovered an old page in the wiki almost about this.
    http://munin.projects.linpro.no/wiki/SpikeRemoval

    --
    Steve Schnepp
    http://blog.pwkf.org/


    2009/11/26 LEVAI Daniel <[email protected]>
    On Thursday 26 November 2009 11.02.56 Nicolai Langfeldt wrote:
    LEVAI Daniel wrote:
    Can you please run "rrdtool tune" on all of the rrd files created by
    the
    plugin and see if the min settings are according to the plugin?
    The min settings were all 'nan'.
    Bummer. What version of munin are you running?
    munin 1.2.6 from Debian lenny. Maybe there will be munin-1.4 package after
    its
    release on backports in the near future.
    If they're not there was a posting earlier today about retuning and
    "normalizing" the rrd file by export/import.
    Those advices worked like charm, now I'm not just protected from future
    peaks, but the past peaks got removed from the graphs too.
    It would be very appreciated if someone entered this, including how to
    fix the rrd files, in the FAQ on the wiki.
    On Thursday 26 November 2009 11.24.43 Steve Schnepp wrote:
    Just did it.
    Thanks!


    Daniel

    --
    LÉVAI Dániel
    PGP key ID = 0x4AC0A4B1
    Key fingerprint = D037 03B9 C12D D338 4412 2D83 1373 917A 4AC0 A4B1


    ------------------------------------------------------------------------------
    Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
    trial. Simplify your report design, integration and deployment - and focus
    on
    what you do best, core application coding. Discover what's new with
    Crystal Reports now. http://p.sf.net/sfu/bobj-july
    _______________________________________________
    munin-users mailing list
    [email protected]
    https://lists.sourceforge.net/lists/listinfo/munin-users

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmunin-users @
categoriesmunin
postedNov 23, '09 at 12:10p
activeNov 30, '09 at 5:05p
posts14
users4
websitemunin-monitoring.org
irc#munin

People

Translate

site design / logo © 2023 Grokbase