From c000676a2afd3a62fdfadcb5e8c981f0ab5b33f0 Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 18 Nov 2015 21:52:32 +0000 Subject: [PATCH] Some more updates for rrdtool tune --- doc/Extensions/RRDTune.md | 21 +++++++++++++++++++++ doc/Support/FAQ.md | 8 ++++++++ scripts/tune_port.php | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 doc/Extensions/RRDTune.md diff --git a/doc/Extensions/RRDTune.md b/doc/Extensions/RRDTune.md new file mode 100644 index 000000000..7ee7095d2 --- /dev/null +++ b/doc/Extensions/RRDTune.md @@ -0,0 +1,21 @@ +# RRDTune? + +When we create rrd files for ports, we currently do so with a max value of 12500000000 (100G). Because of this if a device sends us bad data back then it can appear as though +a 100M port is doing 40G+ which is impossible. To counter this you can enable the rrdtool tune option which will fix the max value to the interfaces physical speed (minimum of 10M). + +To enable this you can do so in three ways! + + - Globally under Global Settings -> External Settings -> RRDTool Setup + - For the actual device, Edit Device -> Misc + - For each port, Edit Device -> Port Settings + +Now when a port interface speed changes (this can happen because of a physical change or just because the device has mis-reported) the max value is set. If you don't want to wait until +a port speed changes then you can run the included script: + +script/tune_port.php -h -p + +Wildcards are supported using *, i.e: + +script/tune_port.php -h local* -p eth* + +This script will then perform the rrdtool tune on each port found using the provided ifSpeed for that port. diff --git a/doc/Support/FAQ.md b/doc/Support/FAQ.md index d7317db4f..d6da5de50 100644 --- a/doc/Support/FAQ.md +++ b/doc/Support/FAQ.md @@ -12,6 +12,7 @@ - [How do I debug the discovery process?](#faq11) - [How do I debug the poller process?](#faq12) - [Why do I get a lot apache or rrdtool zombies in my process list?](#faq14) + - [Why do I see traffic spikes in my graphs?](#faq15) ### Developing - [How do I add support for a new OS?](#faq8) @@ -94,6 +95,13 @@ Please see the [Poller Support](http://docs.librenms.org/Support/Poller Support) If this is related to your web service for LibreNMS then this has been tracked down to an issue within php which the developers aren't fixing. We have implemented a work around which means you shouldn't be seeing this. If you are, please report this in [issue 443](https://github.com/librenms/librenms/issues/443). +#### Why do I see traffic spikes in my graphs? + +This occurs either when a counter resets or the device sends back bogus data making it look like a counter reset. We have enabled support for setting a maximum value for rrd files for ports. +Before this all rrd files were set to 100G max values, now you can enable support to limit this to the actual port speed. + +rrdtool tune will change the max value when the interface speed is detected as being changed (min value will be set for anything 10M or over) or when you run the included script (scripts/tune_port.php). + #### How do I add support for a new OS? The easiest way to show you how to do that is to link to an existing pull request that has been merged in on [GitHub](https://github.com/librenms/librenms/pull/352/files) diff --git a/scripts/tune_port.php b/scripts/tune_port.php index 495c2ad82..2798469cc 100755 --- a/scripts/tune_port.php +++ b/scripts/tune_port.php @@ -9,8 +9,8 @@ rrdtool_pipe_open($rrd_process, $rrd_pipes); $options = getopt('h:p:'); -$hosts = $options['h']; -$ports = $options['p']; +$hosts = str_replace('*', '%', mres($options['h'])); +$ports = str_replace('*', '%', mres($options['p'])); if (empty($hosts) && empty($ports)) {