I have a Python script which takes a single parameter as a device name and changes the device to class to /Ping - it works fine
[img] #!/usr/bin/env python # Description: Move devices from /Discovered to /Ping device class # Run as event command from /Status/Snmp event with # summary contains SNMP agent down # Device Class is /Discovered and count > 5 # Author: Jane Curry [email protected] # Date: Feb 3rd 2009 # Host system: Open SuSE 10.3 # Zenoss ver: 2.3.2 stack-built # Updated: Feb # Comments: TALES expression ${dev/id} passed as single parameter import Globals, re, string import getopt, sys from Products.ZenUtils.ZenScriptBase import ZenScriptBase from transaction import commit dmd = ZenScriptBase(connect=True).dmd device=dmd.Devices.findDevice(sys.argv[1]) device.moveDevices('/Ping', device.id) print 'Moving device %s to class /Ping' % device.id commit() [/img] I want to use the device.moveDevices line in an event transform. I have tested in the transform that I have a pointer to the device in the variable called device. I don't see any errors with the transform - no winges in $ZENHOME/log/event.log but the move device just doesn't work. I have tried including all the active lines from the script in the transform (except for the line that assigns device from sys.argv) but still no class change. Anyone got any good ideas? Thanks, Jane -------------------- m2f -------------------- Read this topic online here: http://forums.zenoss.com/viewtopic.php?p=30910#30910 -------------------- m2f -------------------- _______________________________________________ zenoss-users mailing list [email protected] http://lists.zenoss.org/mailman/listinfo/zenoss-users
