Configuration & Administration

Expand all | Collapse all

Automate Resetting of IP Address for Device

  • 1.  Automate Resetting of IP Address for Device

    Posted 12 days ago
    Zenoss has a menu command to "Reset/Change IP Address" for a device. We have several devices that change IP addresses on a regular basis. What is the actual command which is doing the "reset"? We want to create a notification to automatically run when this condition is detected.

    We are running Zenoss 6.2.1.

    Thanks in advance,

    ------------------------------
    Larry
    ------------------------------


  • 2.  RE: Automate Resetting of IP Address for Device

    Posted 12 days ago
    Hello Larry,

    You could launch a reset command through the API. This is exactly what the Web UI is doing.

    Here is the definition of this command in the DeviceRouter:

    resetIp(self, uids, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', ip='')

    source code 

    Reset IP address(es) of device(s) to the results of a DNS lookup or a manually set address

    Parameters:
    • uids ([string]) - List of device uids with IP's to reset
    • hashcheck (string) - Hashcheck for the devices (from getDevices())
    • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
    • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
    • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
    • sort (string) - (optional) Key on which to sort the return result (default: 'name')
    • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
    • ip (string) - (optional) IP to set device to. Empty string causes DNS lookup (default: '')
    Returns: DirectResponse
    Success or failure message
    I tested it on one of my devices and here was the payload:

    {
    action: "DeviceRouter",
    method: "resetIp",
    data: [
        {ip: "",
         uids: [
            "/zport/dmd/Devices/Server/Microsoft/Windows/myserver.acme.com"],
         hashcheck: null}],

    type: "rpc",
    tid: 1}

    Kind regards,

    ------------------------------
    Laurent Hemeryck
    Monitoring Engineer
    FedNot
    ------------------------------



  • 3.  RE: Automate Resetting of IP Address for Device

    Posted 11 days ago
    Thanks Laurent! I will give that a shot.

    ------------------------------
    Larry
    ------------------------------