From 42123010c821b54b13601e2d53dc16253e53264e Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Mon, 21 Nov 2016 07:08:38 +0000 Subject: [PATCH] refactor: Added support for dskTable in UCD-SNMP-MIB (#4993) --- doc/Support/FAQ.md | 14 +++++++++++++ html/includes/graphs/storage/usage.inc.php | 4 ++-- .../discovery/storage/ucd-dsktable.inc.php | 19 ++++++++++++++++++ includes/include-dir.inc.php | 20 ++++--------------- includes/polling/storage/ucd-dsktable.inc.php | 13 ++++++++++++ 5 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 includes/discovery/storage/ucd-dsktable.inc.php create mode 100644 includes/polling/storage/ucd-dsktable.inc.php diff --git a/doc/Support/FAQ.md b/doc/Support/FAQ.md index 07da680ae7..1ea1bc0538 100644 --- a/doc/Support/FAQ.md +++ b/doc/Support/FAQ.md @@ -23,6 +23,7 @@ source: Support/FAQ.md - [Why do I not see all interfaces in the Overall traffic graph for a device?](#faq23) - [How do I move my LibreNMS install to another server?](#faq24) - [Why is my EdgeRouter device not detected?](#faq25) + - [Why are some of my disks not showing?](#faq26) ### Developing - [How do I add support for a new OS?](#faq8) @@ -227,6 +228,19 @@ If you have `service snmp description` set in your config then this will be why, If you don't have that set then this may be then due to an update of EdgeOS or a new device type, please [create an issue](https://github.com/librenms/librenms/issues/new). +#### Why are some of my disks not showing? + +If you are monitoring a linux server then net-snmp doesn't always expose all disks via hrStorage (HOST-RESOURCES-MIB). We have additional support which will retrieve disks via dskTable (UCD-SNMP-MIB). +To expose these disks you need to add additional config to your snmpd.conf file. For example, to expose `/dev/sda1` which may be mounted as `/storage` you can specify: + +`disk /dev/sda1` + +Or + +`disk /storage` + +Restart snmpd and LibreNMS should populate the additional disk after a fresh discovery. + #### 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/html/includes/graphs/storage/usage.inc.php b/html/includes/graphs/storage/usage.inc.php index 60b01e418f..6d058adecf 100644 --- a/html/includes/graphs/storage/usage.inc.php +++ b/html/includes/graphs/storage/usage.inc.php @@ -30,7 +30,7 @@ $rrd_options .= ' AREA:perc#'.$background['right'].':'; $rrd_options .= ' LINE1.25:perc#'.$background['left'].":'$descr'"; $rrd_options .= ' GPRINT:size:LAST:%6.2lf%sB'; $rrd_options .= ' GPRINT:free:LAST:%6.2lf%sB'; -$rrd_options .= " GPRINT:perc:LAST:%5.2lf%%\\\\n"; +$rrd_options .= " GPRINT:perc:LAST:%5.2lf%%\\n"; if ($_GET['previous']) { $descr = rrdtool_escape('Prev '.$storage['storage_descr'], 12); @@ -48,5 +48,5 @@ if ($_GET['previous']) { $rrd_options .= ' LINE1.25:percX#'.$colour.":'$descr'"; $rrd_options .= ' GPRINT:sizeX:LAST:%6.2lf%sB'; $rrd_options .= ' GPRINT:freeX:LAST:%6.2lf%sB'; - $rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\\\n"; + $rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\n"; } diff --git a/includes/discovery/storage/ucd-dsktable.inc.php b/includes/discovery/storage/ucd-dsktable.inc.php new file mode 100644 index 0000000000..1f0daabbf7 --- /dev/null +++ b/includes/discovery/storage/ucd-dsktable.inc.php @@ -0,0 +1,19 @@ +