ZenDMD Tip - Change Interface Speed

From Zenoss Wiki
Revision as of 20:44, 7 January 2014 by Hydruid (Talk | contribs)$7

Jump to: navigation, search

The following is a zendmd script to set the speed for an interface of a device.

Sometimes after a device is modeled the interface speed can be incorrect.

d = dmd.Devices.findDevice('xensvr02')
for dev in d.Devices.getSubDevices():
    value = d.getProperty(dev)
    for interface in d.os.interfaces():
        if interface.id.startswith('xenbr4'):
            interface.speed = ('1000000000')
            commit ()

Don't forget to lock the interface from updates, or once it's remodeled the change will be lost!

http://hydruid-blog.com/?p=675