Community

Zenoss Newsletter
Monitored by Zenoss
SourceForge.net Logo

How To Call A Method Using Rest

by zenoss last modified 2007-06-08 09:38

Instruction for calling a method on a Zenoss object with a URL

Zenoss's web interface will let you run any method of any object using a simple URL. Calls will be in the following format:

http://USERNAME:PASSWORD@MY_ZENOSS_HOST:8080/PATH_TO_OBJECT/METHOD_NAME?ARG=VAL

  1. USERNAME is the user with the rights to view this information.
  2. PASSWORD is the user's password
  3. MY_ZENOSS_HOST is the hostname or IP of your instance of Zenoss
  4. PATH_TO_OBJECT is the full path to the object you wish to access
  5. METHOD_NAME is the object's method you wish to run
  6. ARG is a method's parameter name
  7. VAL is a methods's parameter value

The following example thanks to Chet Luther (chet.luther@gmail.com):

This example will give the most recent load average of a Linux server:

http://USERNAME:PASSWORD@MY_ZENOSS_HOST:8080/zport/dmd/Devices/Server/Linux/devices/angel/getRRDValue?dsname=laLoadInt5_laLoadInt5

Notice the following things about this URL:

  1. /zport/dmd/Devices/Server/Linux/devices/angel is the full path to our object we wish to access
  2. getRRDValue is the method in the Device object we wish to run
  3. dsname is a parameter to the getRRDValue method.
  4. laLoadInt5_laLoadInt5 is the value of dsname which is the name of the data source we are interested in.

Watching the URLs as you browse the web interface can give you a place to start searching.

AddThis Social Bookmark Button
Document Actions