On Aug 25, 2007, at 4:27 PM, David Carmean wrote:
In order to solve the problem of not being able to find non-SNMP
devices
from the Networks view, I want to add "fake" non-monitored
interfaces using
the manageIp of the device (as described in the archives of this
list).
However, since I have hundreds of such devices I want to do this
programmatically.
I've hacked together a few python tools based on zendmd to do various
tricks for me but so far I haven't been able to figure out how to
add to/associate
with a device a new IpInterface.
If I just do something like
device.os.addIpInterface('mip0','172.31.0.1')
I get an interface named mip0 but with no IP address and with
Monitor set to True.
David,
That is the right way to create the interface. You must then setup
the properties appropriately.
interface = device.os.interfaces._getOb('mip0')
interface.description = 'Added manually from manageIp'
interface.setIpAddresses(device.manageIp)
interface.monitor = False
interface.type = 'manual'
interface.adminStatus = 1
interface.operStatus = 1
interface.speed = 100000000
interface.MTU = 1500
interface.lockFromDeletion()
interface.lockFromUpdates()
You should then create a performance template called "manual" that
contains no data sources. This will prevent the collector daemons
from trying to get status or performance information from this
interface in the case that it is ever accidently set monitor = True.
It is important to call the lockFromDeletion and lockFromUpdates so
that the interface will not be removed the next time the InterfaceMap
collector plugin is run on the device.
Chet Luther
[EMAIL PROTECTED]
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users