Okay...allow me to provide some background first: we've got a large number of Cisco switches and routers on our network (827) and there wasn't enough thought put into what interfaces should be monitored as they were added to NPM and it's now gotten a little out of hand.
We're working on a classic three-layer model of core, distribution and edge switches and, broadly speaking we'd like to monitor all interfaces on all core and distribution switches, regardless of status (Up, Down, Administratively Down) but not monitor any of the 'edge ports' on the edge switches, just CPU, Memory, etc and the gig uplinks to the distribution layer. There's also a fourth layer, edge switches in the server rooms, where we'd still like to monitor all the ports, all the time.
I've put in some preparatory work and created a custom node property called 'Network_Layer' with values as follows for all our network equipment:
10 = Core
20 = Distribution
30 = Static Edge (i.e. server switches, all ports monitored)
40 = Dynamic Edge (i.e. 'user' edge switch, only uplinks monitored)
99 = Other (devices that are uncategorised and we don't want to automate port management for)
I've also added a true/false custom interface property called 'No_Auto_Manage' that will be used to override the 'Network_Layer' for specific interfaces on a device (i.e. a server sitting on a switch with Network_Layer = 40).
Now is where I come undone. I was hoping to find all interfaces for a node listed in the database with a simple monitored or unmonitored switch and issue SQL queries to turn monitoring on or off based on the 'Network_Layer' for the device (with 'No_Auto_Manage' on an interface allowing an override).
Alas, only the monitored interfaces are listed. It seems that the 'List Resources' procedure actually SNMP walks the device in question and adds and removes interfaces from the database based on the selections you make.
So, can anyone think of a way I can automate the 'List Resources' procedure somehow? I've got more than 820 devices I want to set the interfaces up on and doing it manually for every device is going to be very labour intensive.