Bulk disabling modules in LibreNMS

So I was in the process of adding in a large quantity of devices into LibreNMS but noticed a few days later the discovery and polling times were getting longer. Not really to be unexpected as there was more devices but some devices took an abnormally amount of time to finish the SNMP scans. Below is an example how to bulk disable attributes under LibreNMS (likely to work on Observium as well).

Outside of globally disabling different modules we will need to talk directly to the MySQL database in order to accomplish what we are looking for.

In the below example I’m looking at disabling the discover_arp-table on all Windows hosts.

select device_id,hostname from devices where OS = 'windows';

Then copy and paste the results into your favorite editor (I generally use excel for data like this).

="insert into devices_attribs (device_id,attrib_type,attrib_value) values ("""&A2&""",""discover_arp-table"",""0"");"

In the above the “A” column contains all the device_id’s I wish to adjust.

This will generate MySQL insert statements like the below

insert into devices_attribs (device_id,attrib_type,attrib_value) values ("4","discover_arp-table","0");

At this point all you need to do is run the generated MySQL statements against the LibreNMS database to disable the given module in bulk.

, ,
October 27, 2014 at 12:06 pm Comments (0)

Filtering out extra Windows interfaces when monitoring with LibreNMS/Observium

By default when monitoring a Windows-based host with LibreNMS (also for Observium), you’ll see a lot of extra unwanted interfaces present. However, to filter them out globally you need to edit the config.php file. Here’s a basic config that should take of most of the extra network adapters present for Windows Server 2008 through 2012R2. Notice, if you have special teaming configurations they will create their own unique names which this will not remove.

$config['bad_if'][] = "wan miniport (sstp)";
$config['bad_if'][] = "wan miniport (l2tp)";
$config['bad_if'][] = "wan miniport (pptp)";
$config['bad_if'][] = "wan miniport (pppoe)";
$config['bad_if'][] = "wan miniport (ipv6)";
$config['bad_if'][] = "wan miniport (network monitor)";
$config['bad_if'][] = "wan miniport (ip)";
$config['bad_if'][] = "wan miniport (ikev2)";
$config['bad_if'][] = "tap-windows adapter v9";
$config['bad_if'][] = "broadcom netlink (tm) gigabit ethernet-wfp lightweight filter-0000";
$config['bad_if'][] = "software loopback interface 1";
$config['bad_if'][] = "lo";
$config['bad_if'][] = "vmxnet3 ethernet adapter-wfp lightweight filter-0000";
$config["bad_if"][] = "vmxnet3 ethernet adapter #2-wfp lightweight filter-0000";
$config['bad_if'][] = "ras async adapter";
$config["bad_if"][] = "teredo tunneling pseudo-interface";
$config["bad_if"][] = "microsoft kernel debug network adapter";
$config["bad_if"][] = "vmxnet3 ethernet adapter-wfp native mac layer lightweight filter-0000";
$config["bad_if"][] = "vmxnet3 ethernet adapter-wfp 802.3 mac layer lightweight filter-0000";
$config["bad_if"][] = "wan miniport(ip)-wfp native mac layer lightweight filter-0000";

I’ve also included a few specifically if you are running on VMware with the VMXNet3 network adapter.

October 20, 2014 at 10:05 am Comments (0)