Skip navigation
0

public JSONObject removeDevices () throws Exception {

HashMap data = new HashMap();

data.put(“uids”, new ArrayList() {
{
add(“/zport/dmd/Devices/Server/SSH/Linux/devices/deviceName or IP address”);
}
});

data.put(“hashcheck”, 1);
data.put(“uid”, “”);
data.put(“action”, “delete”);

return (JSONObject) this.routerRequest(“DeviceRouter”, “removeDevices”,
data);

}

original code from Zenoss is under below

http://community.zenoss.org/community/documentation/official_documentation/api

 

using java, the sample code of zenoss, I have updated with this alteration.

0

Setting zProperty using JAVA

Posted by Dilip S M Apr 26, 2012
  1. http://community.zenoss.org/community/documentation/official_documentation/api

 

 

 

Download the Sample code from the above link JsonApi.java

is the file to be added with the below code sample to set zProperties from API.

 

 

public JSONObject setZenProperties() throws Exception {

 

 

        HashMap<String, Object> data = new HashMap<String, Object>();

        data.put(

                "uid",

                "/zport/dmd/Devices/Server/SSH/Linux/devices/xyz.com");

 

 

 

        data.put("zProperty", "zCommandUsername");

        data.put("value", "ubuntu");

 

        return (JSONObject) this.routerRequest("DeviceRouter",

                "setZenProperty", data);

    }

 

 

xyx.com or ip how ever we Register to the zenoss for data collection. Alterd file of the zenoss sample, I have uploaded. Which can be used for Reference.



Dilip S M

Dilip S M

Member since: Mar 6, 2012

Zenoss Usage for our needs

View Dilip S M's profile

Recent Comments

No recent comments.