COMPLETE: Poll FDB tables and allow searching for MAC addresses

Yes, there has been a suggestion to add the date for last discovery in the github thread. I will start working on that as soon as the current patch is done and accepted. We are trying not to add anything new to avoid further delays

1 Like

Hi @EnzoZafra,

Ok.
On my network, there are around 60000 @mac in database.
The script don’t work on certain switch, for example 4500x.
The oid isn’t not implemented.


root@test-observium:/opt/librenms# php poller.php -h sw-4500* -vv -m fdb-table
LibreNMS Poller

Version info:
Commit SHA: 483e9b32176cd33d58f5d3d1630d58d541169fa9
Commit Date: 1496133646
DB Schema: 193
PHP: 5.4.45-0+deb7u8
MySQL: 5.5.55-0+deb7u1
RRDTool: 1.4.7
SNMP: NET-SNMP 5.4.3
==================================DEBUG!
Starting polling run:

SQL[SELECT * FROM devices WHERE disabled = 0 AND hostname LIKE β€˜sw-4500%’ ORDER BY device_id ASC]
SQL[SELECT * FROM devices_attribs WHERE device_id = β€˜73’]
Hostname: sw-4500x-vss-vlan11.reseau.nantes.net
Device ID: 73
OS: iosxe (cisco)

SQL[INSERT INTO device_perf (xmt,rcv,loss,min,max,avg,device_id,timestamp) VALUES (β€˜3’,β€˜3’,β€˜0’,β€˜1.16’,β€˜3.75’,β€˜2.32’,β€˜73’,NOW())]
SNMP Check response code: 0
SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OQnUst -m SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss-vlan11.reseau.nantes.net:161 sysUpTime.0 sysLocation.0 sysContact.0 sysName.0 sysObjectID.0]
sysUpTime.0 = 2464899425
sysLocation.0 = Tour Bretagne, Place Bretagne, Nantes
sysContact.0 = DRN-r&t
sysName.0 = sw-4500x-vss.reseau.nantes.net
sysObjectID.0 = enterprises.9.1.1732

SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OvQ -m SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss-vlan11.reseau.nantes.net:161 sysDescr.0]
Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500e-UNIVERSALK9-M), Version 03.08.01.E RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright Β© 1986-2016 by Cisco Systems, Inc.
Compiled Thu 2

SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OQnUst -m HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss-vlan11.reseau.nantes.net:161 snmpEngineTime.0 hrSystemUptime.0]
snmpEngineTime.0 = 24648874
hrSystemUptime.0 = No Such Object available on this agent at this OID

Using SNMP Agent Uptime (24648994s)
RRD[update /opt/librenms/rrd/sw-4500x-vss-vlan11.reseau.nantes.net/uptime.rrd N:24648994]
RRDtool Output: Uptime: 285 days, 6h 56m 34s
SQL[SELECT lat,lng FROM locations WHERE location=β€˜Tour Bretagne, Place Bretagne, Nantes’ LIMIT 1]
Using cached lat/lng from other device

Start Device Groups

SQL[SELECT * FROM device_groups ORDER BY name]
SQL[SELECT DISTINCT(devices.device_id) FROM devices WHERE devices.device_id=β€˜73’ AND (devices.sysName REGEXP β€œsw-manu*” && devices.sysName NOT REGEXP β€œloop-pn-manu*” ) LIMIT 1]
SQL[SELECT DISTINCT(devices.device_id) FROM devices WHERE devices.device_id=β€˜73’ AND (devices.ip REGEXP β€œ10.159.8.*”) LIMIT 1]
SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜73’]
Groups Added:
Groups Removed:

End Device Groups

RRD[update /opt/librenms/rrd/sw-4500x-vss-vlan11.reseau.nantes.net/poller-perf.rrd N:0.499]
RRDtool Output: RRD[update /opt/librenms/rrd/sw-4500x-vss-vlan11.reseau.nantes.net/ping-perf.rrd N:2.32]
RRDtool Output: Polled in 0.499 seconds
Updating sw-4500x-vss-vlan11.reseau.nantes.net
SQL[UPDATE devices set uptime =β€˜24648994’,last_ping =NOW(),last_ping_timetaken =β€˜2.32’,last_polled =NOW(),last_polled_timetaken =β€˜0.499’ WHERE device_id = β€˜73’]
UPDATED!

Start Alerts

SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜73’]
SQL[SELECT alert_schedule.schedule_id FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = β€˜73’ ) && ((alert_schedule.recurring = 0 AND (NOW() BETWEEN alert_schedule.start AND alert_schedule.end)) OR (alert_schedule.recurring = 1 AND (alert_schedule.start_recurring_dt <= date_format(NOW(), β€˜β€“%d’) AND (end_recurring_dt >= date_format(NOW(), β€˜β€“%d’) OR end_recurring_dt is NULL OR end_recurring_dt = β€˜0000-00-00’ OR end_recurring_dt = β€˜β€™)) AND (date_format(now(), β€˜%H:%i:%s’) BETWEEN start_recurring_hr AND end_recurring_hr) AND (recurring_day LIKE CONCAT(’%’,date_format(now(), β€˜β€™),’%’) OR recurring_day is null or recurring_day = β€˜β€™))) LIMIT 1]
SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜73’]
SQL[SELECT alert_rules.* FROM alert_rules LEFT JOIN alert_map ON alert_rules.id=alert_map.rule WHERE alert_rules.disabled = 0 && ( (alert_rules.device_id = -1 || alert_rules.device_id = β€˜73’ ) || alert_map.target = β€˜73’ )]

End Alerts

SQL[SELECT * FROM devices_attribs WHERE device_id = β€˜75’]
Hostname: sw-4500x-vss.reseau.nantes.net
Device ID: 75
OS: iosxe (cisco)

SQL[INSERT INTO device_perf (xmt,rcv,loss,min,max,avg,device_id,timestamp) VALUES (β€˜3’,β€˜3’,β€˜0’,β€˜2.10’,β€˜4.89’,β€˜3.09’,β€˜75’,NOW())]
SNMP Check response code: 0
SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OQnUst -m SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss.reseau.nantes.net:161 sysUpTime.0 sysLocation.0 sysContact.0 sysName.0 sysObjectID.0]
sysUpTime.0 = 2464899478
sysLocation.0 = Tour Bretagne, Place Bretagne, Nantes
sysContact.0 = DRN-r&t
sysName.0 = sw-4500x-vss.reseau.nantes.net
sysObjectID.0 = enterprises.9.1.1732

SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OvQ -m SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss.reseau.nantes.net:161 sysDescr.0]
Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500e-UNIVERSALK9-M), Version 03.08.01.E RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright Β© 1986-2016 by Cisco Systems, Inc.
Compiled Thu 2

SNMP[/usr/bin/snmpget -v2c -c β€˜public’ -OQnUst -m HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:sw-4500x-vss.reseau.nantes.net:161 snmpEngineTime.0 hrSystemUptime.0]
snmpEngineTime.0 = 24648874
hrSystemUptime.0 = No Such Object available on this agent at this OID

Using SNMP Agent Uptime (24648994s)
RRD[update /opt/librenms/rrd/sw-4500x-vss.reseau.nantes.net/uptime.rrd N:24648994]
RRDtool Output: OK u:0,00 s:0,00 r:0,51
OK u:0,00 s:0,00 r:0,52
OK u:0,00 s:0,00 r:0,54
Uptime: 285 days, 6h 56m 34s
SQL[SELECT lat,lng FROM locations WHERE location=β€˜Tour Bretagne, Place Bretagne, Nantes’ LIMIT 1]
Using cached lat/lng from other device

Start Device Groups

SQL[SELECT * FROM device_groups ORDER BY name]
SQL[SELECT DISTINCT(devices.device_id) FROM devices WHERE devices.device_id=β€˜75’ AND (devices.sysName REGEXP β€œsw-manu*” && devices.sysName NOT REGEXP β€œloop-pn-manu*” ) LIMIT 1]
SQL[SELECT DISTINCT(devices.device_id) FROM devices WHERE devices.device_id=β€˜75’ AND (devices.ip REGEXP β€œ10.159.8.*”) LIMIT 1]
SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜75’]
Groups Added:
Groups Removed:

End Device Groups

RRD[update /opt/librenms/rrd/sw-4500x-vss.reseau.nantes.net/poller-perf.rrd N:0.503]
RRDtool Output: RRD[update /opt/librenms/rrd/sw-4500x-vss.reseau.nantes.net/ping-perf.rrd N:3.09]
RRDtool Output: Polled in 0.503 seconds
Updating sw-4500x-vss.reseau.nantes.net
SQL[UPDATE devices set uptime =β€˜24648994’,last_ping =NOW(),last_ping_timetaken =β€˜3.09’,last_polled =NOW(),last_polled_timetaken =β€˜0.503’ WHERE device_id = β€˜75’]
UPDATED!

Start Alerts

SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜75’]
SQL[SELECT alert_schedule.schedule_id FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = β€˜75’ ) && ((alert_schedule.recurring = 0 AND (NOW() BETWEEN alert_schedule.start AND alert_schedule.end)) OR (alert_schedule.recurring = 1 AND (alert_schedule.start_recurring_dt <= date_format(NOW(), β€˜β€“%d’) AND (end_recurring_dt >= date_format(NOW(), β€˜β€“%d’) OR end_recurring_dt is NULL OR end_recurring_dt = β€˜0000-00-00’ OR end_recurring_dt = β€˜β€™)) AND (date_format(now(), β€˜%H:%i:%s’) BETWEEN start_recurring_hr AND end_recurring_hr) AND (recurring_day LIKE CONCAT(’%’,date_format(now(), β€˜β€™),’%’) OR recurring_day is null or recurring_day = β€˜β€™))) LIMIT 1]
SQL[SELECT device_group_id FROM device_group_device WHERE device_id=β€˜75’]
SQL[SELECT alert_rules.* FROM alert_rules LEFT JOIN alert_map ON alert_rules.id=alert_map.rule WHERE alert_rules.disabled = 0 && ( (alert_rules.device_id = -1 || alert_rules.device_id = β€˜75’ ) || alert_map.target = β€˜75’ )]

End Alerts

SQL[INSERT INTO perf_times (type,doing,start,duration,devices,poller) VALUES (β€˜poll’,β€˜sw-4500*’,β€˜1496845811.2085’,β€˜1.069’,β€˜2’,β€˜test-observium\n’)]
poller.php sw-4500* 2017-06-07 16:30:12 - 2 devices polled in 1.069 secs
SNMP: Get[8/0.15s] Walk [0/0.00s]
MySQL: Cell[8/0.01s] Row[2/0.00s] Rows[9/0.01s] Column[6/0.00s] Update[2/0.01s] Insert[3/0.01s] Delete[0/0.00s]


Best regards

Cisco 4500x runs iosxe - therefore it is not implemented yet. Only ios and comware are supported. Developers are free to create support for additional OS’ but at the moment I am not able to

Hello @EnzoZafra ,

It seems to have bug.
When I select a switch (1)

I select an interface (2)
I choice FDB table (3)
4 > In this picture, I can see all @mac of FDB, not only for this interface.

This features is very great, thank you

Best regard,