Jul 12, 2013 2:30 AM
Some questions about adding device
-
Like (0)
Hi everyone, now I am making a zenpack. I have a question that how can I add some simple devices with some codes in my zenpack. I want to make that like the interface like the "Add a simple device " in the page. But I want to only use the method to add simple devices. What's the method or way should I make? I know the code "dmd.DeviceLoader.loadDevice(deviceName='', discoverProto=None, devicePath='')" that can add a device.
But it will run as following:
2013-07-12 14:25:46,571 INFO zen.ZenDisc: Connecting to localhost:8789
2013-07-12 14:25:46,581 INFO zen.ZenDisc: Connected to ZenHub
2013-07-12 14:25:46,791 INFO zen.ZenDisc: Looking for 192.168.186.130
2013-07-12 14:25:47,425 INFO zen.ZenDisc: Result: Discovered device 192.168.186.130.
2013-07-12 14:25:47,658 INFO zen.ZenDisc: No WMI plugins found for 192.168.186.130
2013-07-12 14:25:47,664 INFO zen.ZenDisc: No Python plugins found for 192.168.186.130
2013-07-12 14:25:47,671 INFO zen.ZenDisc: No command plugins found for 192.168.186.130
2013-07-12 14:25:47,682 INFO zen.ZenDisc: SNMP collection device 192.168.186.130
2013-07-12 14:25:47,682 INFO zen.ZenDisc: plugins: zenoss.snmp.NewDeviceMap, zenoss.snmp.DeviceMap, zenoss.snmp.InterfaceMap, zenoss.snmp.RouteMap, zenoss.snmp.IpServiceMap, zenoss.snmp.HRFileSystemMap, zenoss.snmp.HRSWInstalledMap, zenoss.snmp.HRSWRunMap, zenoss.snmp.CpuMap
2013-07-12 14:25:47,692 INFO zen.ZenDisc: No portscan plugins found for 192.168.186.130
2013-07-12 14:26:01,348 INFO zen.SnmpClient: snmp client finished collection for 192.168.186.130
2013-07-12 14:26:01,349 INFO zen.ZenDisc: Processing zenoss.snmp.NewDeviceMap for device 192.168.186.130
2013-07-12 14:26:01,351 INFO zen.ZenDisc: processing zenoss.snmp.DeviceMap for device 192.168.186.130
2013-07-12 14:26:01,356 INFO zen.ZenDisc: Modeler zenoss.snmp.InterfaceMap processing data for device 192.168.186.130
2013-07-12 14:26:01,360 INFO zen.ZenDisc: processing zenoss.snmp.RouteMap for device 192.168.186.130
2013-07-12 14:26:01,364 INFO zen.ZenDisc: processing zenoss.snmp.IpServiceMap for device 192.168.186.130
2013-07-12 14:26:01,366 INFO zen.ZenDisc: Modeler zenoss.snmp.HRFileSystemMap processing data for device 192.168.186.130
2013-07-12 14:26:01,367 INFO zen.ZenDisc: Skipping Swap space (virtualMemory) as it matches zFileSystemMapIgnoreTypes.
2013-07-12 14:26:01,368 INFO zen.ZenDisc: Skipping /sys/fs/fuse/connections. 0 total blocks.
2013-07-12 14:26:01,368 INFO zen.ZenDisc: Skipping /home/zenoss/.gvfs. 0 total blocks.
2013-07-12 14:26:01,369 INFO zen.ZenDisc: Skipping /var/run/vmblock-fuse. 0 total blocks.
2013-07-12 14:26:01,369 INFO zen.ZenDisc: Skipping Physical memory (ram) as it matches zFileSystemMapIgnoreTypes.
2013-07-12 14:26:01,369 INFO zen.ZenDisc: Skipping Cached memory (other) as it matches zFileSystemMapIgnoreTypes.
2013-07-12 14:26:01,369 INFO zen.ZenDisc: Skipping Memory buffers (other) as it matches zFileSystemMapIgnoreTypes.
2013-07-12 14:26:01,370 INFO zen.ZenDisc: Skipping Shared memory. 0 total blocks.
2013-07-12 14:26:01,370 INFO zen.ZenDisc: processing zenoss.snmp.CpuMap for device 192.168.186.130
2013-07-12 14:26:05,976 INFO zen.ZenDisc: Changes in configuration applied
2013-07-12 14:26:05,977 INFO zen.ZenDisc: Scan time: 18.55 seconds
2013-07-12 14:26:06,021 INFO zen.ZenDisc: Daemon ZenDisc shutting down
But I want to submit a task, then it runs commands in the background. How was it?
Thanks!
-----
James
Not that. It is not what I want to have. In fact, my dream is that when I have find a new IP, I can automatically to add the device, not to add it from the page. I have seen your example zenpack. Although it is very useful, it is not really what I think about.
Anything else.
Thank you, jcurry!
----
James
Go and look again at the __init__.py in the main directory. An instance of a device called Example1 is created.
Cheers,
Jane
Do you mean the code as following:
if dc.devices._getOb('ExampleDevice1', None): return
myInst = dc.createInstance('ExampleDevice1')
myInst.setPerformanceMonitor('localhost')
Whether the method createInstance is only to create a device instance, can the device be modeled? And if I write the code in the __init__.py in the main directory, can the zenoss automatically add the device when it find a new IP?
Now I am making a zenpack. It needs that If it finds a new IP address, the zenoss can automatically add the device, Not only the device instance but also modeling the device.
Cheers,
-----
James
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||