Last interface stace CISCO switch

This is my first post here at the NimSoft forum. I've got some CISCO 3750 stacks that I want to run a report on for last up time on interfaces. I would like to get a simple text layout like this:

Interface Name Last Up TimeGi1/0/1 10/25/09 11:59am

There will be over 100 interfaces, so a graph format will not really work. What I'm actually trying to accomplish is to find all ports that have been inactive for a period of time so that I can re-purpose those ports. I've added the switches and interface in the interface_traffic probe, and is working well. Ideally, I'd like to report on this without getting alerts of down interfaces as these are user access ports, and will change states frequently.

First, this can be achieved in 2 ways. One would be to interact with the interface_traffic probe on a per host per interface basis. This would cause quite some overhead depending on the number of devices/interfaces you want to collect data from.

The other solution which is faster and more effective is by using the NSA with its builtin SNMP capabilities.Here's a tiny script I wrote that walks the interfaces part of MIB-II and grabs some of the data from this mib. Look out for the ifLastChange since this should be set when the OperStatus changed. This value is a Timetick (centiseconds). Compute the delta between the sysUptime and the ifLastChange, devide by 100 and you'll have the number of seconds since the change.

Here's a litte script that will list the interfaces for a device printing the ifIndex, ifOperStatus, ifDescr and the number of seconds since the last change.

-- First find and prepare the indexes for later use for k,v in pairs(result.oids) do if left (v.oid,ifIndex:len())==ifIndex then table.insert (indexes,v.value) end end -- Then get data per index from walk result for k,i in pairs(indexes) do

This looks really good. This will get what I need without generating alerts. I've dragged the NSA probe into my hub node and it installed, but it is not showing up in the hub node probe list. I'll have to look deeper into this.

This looks really good. This will get what I need without generating alerts. I've dragged the NSA probe into my hub node and it installed, but it is not showing up in the hub node probe list. I'll have to look deeper into this.

The NSA is not a probe, so like the other SDKs, it will not appear in the probe list. You can use it to create custom probes or scripts, which would rely on the nsa.exe (or just nsa on Linux/Unix) command.

I do not think you need a license for the NSA, so you should be all set in that respect.

The NSA is not a probe, so like the other SDKs, it will not appear in the probe list. You can use it to create custom probes or scripts, which would rely on the nsa.exe (or just nsa on Linux/Unix) command.

I do not think you need a license for the NSA, so you should be all set in that respect.

The printf statement is a formatted print, and should read printf ("v= %s",v). This requires v to be of a string type (or use print ("v=",v) ). You could try to use the function below, it dumps the return data from the snmp.query call. It would seem that the the function centiseconds fails to split the incoming argument. It expects the ifLastChange..i (ifLastChange-oid concatenated with the index i). You could try to do this in 2 statements and printing the result: