Archived community.zenoss.org | full text search
Skip navigation
29029 Views 3 Replies Latest reply: Mar 10, 2009 1:30 PM by mosburn RSS
tec Rank: Green Belt 197 posts since
Oct 21, 2008
Currently Being Moderated

Jan 8, 2009 5:29 PM

Add device script problem

Hi

Zenoss V2.3.2 VM Appliance

I have a very simple script that should load a device.
The script info was taken from the Developers Guide,
Chapter 7, Sec 7.1.2, "Using an XML-RPC Call from Python".

Script is below:
===============================================
#! /usr/bin/env python

from xmlrpclib import ServerProxy

nmshost = ServerProxy('http://admin:zenoss@192.168.1.24:8080/zport/dmd/DeviceLoader')

nmshost.loadDevice({'deviceName':'192.168.1.14', 'devicePath':'/Devices/Network/Switch'})
===============================================

My problem is that it does nothing. :-(

It resolves quietly and does not add the device.

Can anyone help?
  • perlmonky Rank: White Belt 8 posts since
    Mar 10, 2009
    Currently Being Moderated
    2. Mar 10, 2009 12:55 PM (in response to tec)
    Re: Add device script problem
    Looks like this is an issue with the service changing and the documentation not reflecting the change:

    new way:



    #! /usr/bin/env python

    from xmlrpclib import ServerProxy

    nmshost = ServerProxy('http://admin:zenoss@192.168.1.24:8080/zport/dmd/DeviceLoader')

    nmshost.loadDevice('192.168.1.14', '/Devices/Network/Switch')

    additional parameters in order are:

    deviceName,
    devicePath,
    tag,
    serialNumber,
    zSnmpCommunity,
    zSnmpPort,
    zSnmpVer,
    rackSlot,
    productionState,
    comments,
    hwManufacturer,
    hwProductName,
    osManufacturer,
    osProductName,
    locationPath,
    groupPaths,
    systemPaths,
    performanceMonitor,
    discoverProto,
    priority,
  • mosburn Rank: White Belt 78 posts since
    Feb 21, 2008
    Currently Being Moderated
    3. Mar 10, 2009 1:30 PM (in response to perlmonky)
    Re: Add device script problem
    Thanks for the list of additional parameters. This comes at the perfect time as I am looking at writing some new scripts.

More Like This

  • Retrieving data ...