Would one of you be able to get me the following info:
Polling time before the change
Polling time after the change.
The ātimeā value of this command: time snmpbulkwalk -OUneb -m IF-MIB -M /opt/librenms/mibs -v2c -c COMMUNITY HOSTNAME ifOperStatus
Here are two gists (I wasnāt sure exactly which time values would be useful to you, so I used ./poller.php -h HOSTNAME | grep " seconds$\\|s\]$" to get all of the timing-related output):
A fresh standalone Juniper EX3300-48P (nothing active, nothing disabled)
A production Juniper EX3300-48P virtual-chassis with 8 member switches (many active/inactive access ports, many deactivated ports)
Ok so Iāve updated the code to now ignore ports which are currently down and were down on the last poll, if anyone wants to try that then just git pull on my branch
All updated again. I canāt compare before the check for ports down but Iāve seen a few seconds of a couple of devices which have about 1300 ports, non-deleted but a lot of them are down.
Hi Laf,
any intentions to make this also work with Python 3?
I already āhackedā the existing script to make it work and I am more then happy to hand it over into professional hands for wider consumption. Just let me know.
Ok, after running this for a while, I think there may be a need (for me) to better understand what this is doing. Some observations and possible issues:
ports that are disabled in the switch configuration donāt show up in the Overview and Ports tabs. This isnāt really a problem for me, just and observation that may be confusing.
ports that are disabled for a time, and then are reactivated arenāt polled until after the switch gets re-discovered.
some weirdness with Juniper where an active logical interface, say ge-0/0/46.0, is polled, but the parent physical interface, ge-0/0/46, is marked as deleted and is not polled⦠Not sure how this gets messed up, nor how to fix.
Iād have to spend some more time learning what this code does in order to even begin to recommend specific changes, but here are my thoughts:
What are the criteria for selecting ports to not poll? Iām guessing checking whether ifAdminStatus == down. Is that correct?
To flag the ports that we donāt want to waste time polling, Iām guessing the mechanism is to set deleted = 1. Is that correct?
Regardless of the flag, I would say that each polling cycle we should check the ifAdminStatus of each port (poll the switch for this value, not looking at the DB)
if (ifAdminStatus != down and deleted != 0) then set deleted = 0
if (ifAdminStatus == down and ifAdminStatus_prev == down and deleted != 1) then set deleted = 1
After step 2 above, do the detailed interface poll on the ports where deleted != 1
From the code, the only way a port will be deleted is if it doesnāt pass the is_port_valid() check which would happen without this change in code from what I can see.
Ideally Iād need to see the output of ./poller.php -h HOSTNAME -r -f -d -m ports
add a block of code where we check to see the admin and oper status of the deleted ports, if they are up/up, we update the database and set deleted = 0 for these ports. this happens before we loop through the nondeleted ports
instead of checking ifOperStatus, ifOperStatus_prev, ifAdminStatus, and ifAdminStatus_prev to see if theyāre ādownā, check to see if theyāre ānot upā - this is important at least for ifOperStatus, as the value can be up, down, or lowerLayerDown (maybe other values too?)
later on, there is some code that would only update the ifOperStatus_prev and ifAdminStatus_prev values in the database if the value is null. I was finding that the values would sometimes not be updated at all, so removed the conditional.
I added/modified a some echo statements that could be cut out before merging.
Hi Folks, I think it would be beneficial to have some tweaking especially if weāre heading for 1 minute fast polling. I guess it would make sense to have something like enable modules per device group or bake more intelligence into the polling. Why even try polling for OTV on an ASA or a Linux server or IPMI on a virtual machine?
Also I just wonder if itās feasible to dynamically group devices or modules by OID response time. Like while I would like to poll IPSLA every minute donāt do that for my full BGP table.