OpManager - The

network, server and virtualization monitoring software

OpManager REST APIs

OpManager offers REST APIs for adding and fetching data from OpManager. Using these APIs, you can integrate OpManager with 3rd party IT management/service desk software.

How OpManager REST APIs work?

The APIs work with an API key. The API key is unique for each OpManager account and has to passed as a parameter in every API request made. First, generate an API key.

Generate API Key

To generate an API key, go to Admin-> REST API in OpManager web client and click on Generate Key.

Actions Supported via API

OpManager offers API for the following actions:

Error Codes

Click here to know the list of error codes of OpManager.

Add a Device

Purpose: To add a device in OpManager.
Prerequisite: The credentials of the device should be added in the credential library.
Request URL: http://<opmanager-server:port>/api/xml/discovery/addDevice?apiKey=APIKEY&deviceName=DEVICE-NAME
&netmask=NETMASK&credentialName=CREDENTIAL-NAME

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
deviceName* Name of the device to be added.
netmask Enter the netmask for discovering the device.
credentialName Enter the appropriate credential.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/addDevice?apiKey=[APIKEY]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="hidden" name="netmask" value="[NETMASK]">
<input type="hidden" name="credentialName" value="[CREDENTIAL-NAME]">
<input type="submit" value="Add Device" name="submit">
<⁄form>

Examples:

  • http://opman-vm-win7-2/api/xml/discovery/addDevice?apiKey=4f2526a41d9c23f9ee2eecb03f3b6d9f
    &deviceName=10.10.10.1&netmask=255.255.255.0&credentialName=Public
  • http://opman-vm-win7-2/api/xml/discovery/addDevice?apiKey=4f2526a41d9c23f9ee2eecb03f3b6d9f
    &deviceName=opmanager-win2k8-3&netmask=255.255.255.0&credentialName=Public
  • http://opman-vm-win7-2/api/xml/discovery/addDevice?apiKey=4f2526a41d9c23f9ee2eecb03f3b6d9f
    &deviceName=opmanager-win2k8-2.csez.zohocorpin.com&netmask=255.255.255.0&credentialName=Public

Add a Device to Business View

Purpose: To add a device to a Business View in OpManager.
Prerequisite: Business View should have been already created.
Request URL: http://<opmanager-server:port>/api/xml/discovery/addDeviceToBV?apiKey=APIKEY
&deviceName=DEVICE-NAME&bvName=BUSINESSVIEW-NAME

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
deviceName* Name of the device to be added in business view.
bvName* Name of the business view.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/addDeviceToBV?apiKey=[APIKEY]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="hidden" name="bvName" value="[BUSINESSVIEW-NAME]">
<input type="submit" value="Add Device to BV" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/discovery/addDeviceToBV?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &deviceName=COREROUTER&bvName=TexasDatacenter

Delete a Device

Purpose: To delete a device device in OpManager.
Prerequisite: None.
Request URL: http://<opmanager-server:port>/api/xml/discovery/deleteDevice?apiKey=APIKEY&deviceName=DEVICE-NAME

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
deviceName* Name of the device to be deleted.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/deleteDevice?apiKey=[APIKEY]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="submit" value="Delete Device" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/discovery/deleteDevice?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &deviceName=COREROUTER

Display a Device on Google Map

Purpose: To display an already added device on Google Map.
Prerequisite: Google Map should be working in OpManager and the device you want to display should be added already.
Request URL: http://<opmanager-server:port>/api/xml/discovery/addDeviceToGMap?apiKey=APIKEY
&deviceName=DEVICE-NAME&latitude=LATITUDE&longitude=LONGITUDE

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
deviceName* Name of the device to be added in business view.
latitude* Latitude of the location where the device is present.
longitude* Longitude of the location where the device is present.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/addDeviceToGMap?apiKey=[APIKEY]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="hidden" name="latitude" value="[LATITUDE]">
<input type="hidden" name="longitude" value="[LONGITUDE]">
<input type="submit" value="Display Device in GM" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/discovery/addDeviceToGMap?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &deviceName=device1&latitude=38.625453&longitude=-120.145568

Add a Notification Profile to a device

Purpose: To add a notification profile to a device.
Prerequisite: Notification profile should already be created and the device should be already added.
Request URL: http://<opmanager-server:port>/api/xml/discovery/addDeviceToNProfile?apiKey=APIKEY&deviceName=DEVICE-NAME&profileName=PROFILE-NAME&criteria=CRITERIA-ID

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
deviceName* Name of the device to be added in business view.
profileName* Name of the notification profile.
criteria* There are 26 criteria. Refer the below table.
* - Mandatory parameters

CRITERIA ID

Criteria Criteria ID
3 polls missed 3000000000000000000000000
5 polls missed 5000000000000000000000000
Trap -> received 0100000000000000000000000
Interface -> problems 0010000000000000000000000
NT Service --> down 0001000000000000000000000
Windows Service --> down 0000100000000000000000000
Event Log --> generates alarm 0000010000000000000000000
SysLog --> generated alarm 0000001000000000000000000
AdMonitor --> down 0000000100000000000000000
Exchange Monitor --> down 0000000010000000000000000
MSSQL Monitor --> violated 0000000001000000000000000
AdService --> down 0000000000100000000000000
Exchange Service --> down 0000000000010000000000000
MSSQL Service --> down 0000000000001000000000000
Threshold --> violated 0000000000000100000000000
Process Monitor --> violated 0000000000000010000000000
IPSLA Monitor --> violated 0000000000000001000000000
File Monitor --> violated 0000000000000000100000000
Folder Monitor --> violated 0000000000000000010000000
Printer Monitor --> violated 0000000000000000001000000
UPS Monitor --> down 0000000000000000000100000
URL --> down 0000000000000000000010000
Virtual Device Monitor --> down 0000000000000000000001000
Script Monitor --> down 0000000000000000000000100
Probe --> down 0000000000000000000000010
Alarm --> cleared 0000000000000000000000001

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/addDeviceToNProfile?apiKey=[APIKEY]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="hidden" name="profileName" value="[PROFILE-NAME]">
<input type="hidden" name="criteria" value="[CRITERIA-ID]">
<input type="submit" value="Associate to NP" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/discovery/addDeviceToNProfile?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &deviceName=device1&profileName=Testprofile&criteria=3000000000000000000000000

Add an Event

Purpose: To generate events in OpManager.
Prerequisite: Device should be already added.
Request URL: http://<opmanager-server:port>/api/xml/events/addEvent?apiKey=APIKEY
&source=DEVICE-NAME&severity=SEVERITY-ID&message=EVENT-MESSAGE
&alarmCode=ALARM-CODE&entity=ENTITY&eventType=EVENT-TYPE

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
source* Name of the source device of the event.
severity* The severity of the event. Following are the severity levels and its ID:
Critical - 1
Trouble - 2
Attention - 3
Service Down - 4
message* The message that is displayed when the event is generated.
alarmCode Unique string used to trigger the event. Eg:-Threshold-DOWN
entity Uniquely identifies the failure object within the source.Events will be correlated into alarms according to the entity field. Multiple events with the same entity will be grouped as a single alarm.
eventType Description of the event type
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/events/addEvent?apiKey=[APIKEY]">
<input type="hidden" name="source" value="[DEVICE-NAME]">
<input type="hidden" name="severity" value="[SEVERITY-ID]">
<input type="hidden" name="message" value="[EVENT-MESSAGE]">
<input type="hidden" name="alarmCode" value="[ALARM-CODE]">
<input type="hidden" name="entity" value="[ENTITY]">
<input type="hidden" name="eventType" value="[EVENT-TYPE]">
<input type="submit" value="Add Event" name="submit">
<⁄form>

Examples:

  • http:///api/xml/events/addEvent?apiKey=71f3a24c9aa776325b628108b44ef5b6&source=opman-winxp1
    &severity=2&message=Process%20Down&alarmCode=ProcessMonitor_CPU_DOWN
    &entity=event_entity&eventType=Process%20Monitor%20Down

Add a Business View

Purpose: To add a new Business View in OpManager.
Prerequisite: Devices should be already added.
Request URL: http://<opmanager-server:port>/api/xml/discovery/addBusinessView?apiKey=APIKEY
&bvName=BUSINESS-VIEW-NAME&deviceName=DEVICE-NAME

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
bvName* Name of the Business View.
deviceName* Name of the device to be added.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/discovery/addBusinessView?apiKey=[APIKEY]">
<input type="hidden" name="bvName" value="[BUSINESS-VIEW-NAME]">
<input type="hidden" name="deviceName" value="[DEVICE-NAME]">
<input type="submit" value="Add Business View" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/discovery/addBusinessView?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &bvName=Test&deviceName=COREROUTER

Add a User

Purpose: To add a new user in OpManager.
Prerequisite: None.
Request URL: http://<opmanager-server:port>/api/xml/admin/addUser?apiKey=APIKEY
&userName=USER-NAME&password=PASSWORD&privilege=ACCESS-LEVEL
&bvName=BUSINESS-VIEW-NAME&emailId=EMAIL-ID&landLine=PHONE-NO
&mobilNo=MOBILE-NO

Request Parameters:

Parameter Description
apiKey* API Key to access your OpManager server.
userName* User name
password* password
privilege* Privilege for the user. Following privileges are available
* Administrators - Full Access
* Operators - Restricted Access
bvName Provides access to the devices devices grouped in the specified business view. Multiple business views can be given by comma separated.
emailId Email ID of the user.
landLine Land line number of the user.
mobileNo Mobile number of the user.
* - Mandatory parameters

Sample Form (Post Method):

<form method="POST" action="http://opman-vm-win7-2/api/xml/admin/addUser?apiKey=[APIKEY]">
<input type="hidden" name="userName" value="[USER-NAME]">
<input type="hidden" name="password" value="[PASSWORD]">
<input type="hidden" name="privilege" value="[ACCESS-LEVEL]">
<input type="hidden" name="bvName" value="[BUSINESS-VIEW-NAME]">
<input type="hidden" name="emailId" value="[EMAIL-ID]">
<input type="hidden" name="landLine" value="[PHONE-NO]">
<input type="hidden" name="mobileNo" value="[MOBILE-NO]">
<input type="submit" value="Add Business View" name="submit">
<⁄form>

Examples:

  • http://localhost/api/xml/admin/addUser?apiKey=85d6e56d16ae90fbdf3ef7079ad1232b
    &userName=adminUser&password=adminUsr&privilege=Administrators
    &bvName=Test&emailId=john@zohocorp.com&landLine=04422584098
    &mobilNo=9856008447

Error codes in OpManager:

Error Code Message
5000 Internal server error.
5001 Authentication failure.
5002 Specified URL is incorrect.
5003 Mandatory field not available.
5004 Operation blocked in central server.
5005 Request type is not supported.
5006 Value specified for a parameter is empty.
5007 Special characters are used.
5008 Parameter length exceeded the limit.
5009 Wrong value is specified for a parameter.
5050 Permission not provided to perform an operation.
5051 Device does not exist in OpManager.
5052 Multiple devices are available with the same name.
5053 Device does not exist in OpManager.
5111 Delete device operation failed.
5121 Invalid IP address is specified.
5122 Network IP is provided.
5123 Device already exists in OpManager.
5124 Device is not reachable by OpManager.
5125 IP address does not exist.
5126 Credentials provided does not exist.
5127 Add device operation has failed.
5131 Business view does not exist in OpManager.
5132 Device already exists in the business view.
5141 Device already exists in Google map.
5142 Adding device to Google map has failed.
5151 Notification profile does not exist.
5152 Invalid criteria specified in the notification profile.
5153 No criteria is selected in the notification profile.
5156 Business view already exists.
5157 Add business view operation has failed.
5161 Add user operation has failed.
5162 User limit has been exceeded.
5163 The value specified for privilege is wrong. It should be either Administrators or Operators.
5164 User already exists.
5165 Business view does not exist.