Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width300px

Table of Contents
 

Column
width400px
Panel
bgColor#f4f4f4
titleRelated Articles
Column
width400px

Filter by label (Content by label)
labelswiki

Introduction

The SONARPLEX REST API offers an easy way to gather information and even post information to the SONARPLEX. 

API Basics

Base URIhttp(s)://example.com/{version}/{location}/{resource}/
AuthenticationBasic HTTP Auth
Encryption

HTTPS with certificate can be configured in the

administrative web interface Configuration :: Network :: HTTP Configuration

EncodingUTF-8
MethodsGET and POST depending on the resource
Response content typeapplication/json
WildcardAsterisk '*'

...

400px
Column
width
or 'all'
Restrictions
Note
The RESTful API access

Access is restricted

to username

to the admin interface (usually port 81) and to user 'admin'

Column
width300px
Panel
bgColor#f4f4f4
borderStylesolid

In this article:

Table of Contents

Resource Path

The reosurce path specifies which location information should be accessed.

Especially if the device receives data from remote satellites (See Distributed Monitoring and Integration Interfaces).

Level1234
DescriptionVersionTenantLocationResources
Example 1
/v1
/all
/local
/hosts/*
Example 2
/v1
/aeg
/berlin
/services/ping
Example 3
/v1
/siemens
/site382
/problems

Resources

/hosts

Example/hosts/{host_name|*|all}
Get all hosts
hosts/*

Get all hosts, filter details for the fields current_state and plugin_output

hosts/*?fields=current_state,plugin_output
Get onyl details for the host named 'Google' with all details
hosts/Google

/services

Example/services/{service_name|*|all}
Get all services
services/*

Get all hosts for services 'ICMP'

services/ICMP/hosts/*
Get all hosts for service 'ICMP' but only show particular fields
services/ICMP/hosts/*?fields=current_state,plugin_output 
Get the full detail view for service 'ICMP' on host 'SAP'
services/ICMP/hosts/SAP
Get all services for host 'Email_Loop'
services/*/hosts/Email_Loop
Get all services for host 'Email_Loop' but only show certain fields
services/*/hosts/Email_Loop?fields=current_state,plugin_output

/problems

Example/servicesproblems/{service_namehosts|services|*|all}
Get all problems
problems/*

Get all problems for service 'Mail_out'

problems/services/Mail_out/hosts/*
Get all problems of host 'Email_Loop'
problems/services/*/hosts/Email_Loop
Get detail view for problem of host 'Email_Loop' for service 'Mail_out'
problems/services/Mail_out/hosts/Email_Loop
Get all problems of host 'Email_Loop'
problems/services/*/hosts/Email_Loop

Acknowledge host Problem

...

/comments

Example/comments/{hosts|services|*|all}
Get all commentscomments/*
Get the comments detail of service 'Jobs' on host 'SAP'comments/hosts/SAP/services/Jobs

/downtimes

Example/downtimes/{hosts|services|*|all}
Get all downtimesdowntimes/*
Get the downtime detail of service 'Jobs' on host 'SAP'downtimes/hosts/SAP/services/Jobs

/cmd

Column
width75%
Info

Find a full list of compatible external commands here.

Example/cmd/{command_name}
Acknowledge host problem
cmd/ACKNOWLEDGE_HOST_PROBLEM/Google/1/1/1/Operator/

...

'Aware of this problem, acknowledged

...

Process Host Check-Result

...

'
Acknowledge service problem
cmd/ACKNOWLEDGE_SVC_PROBLEM/-azeti-A-/Email-Msg-Queue/1/1/1/admin/problem%20is%20known%20so%20far
Process external host check result
cmd/PROCESS_HOST_CHECK_RESULT/Google/0/

...

OK - Wieder ein Fake|pkt=1;;0;2 rta=20.945;1000.000;2000.000;

Process active Host Check

...

/checknow

...

...

Example

All services

...

/

...

All services with name ICMP

http://192.168.111.1/v1/*/local/services/ICMP/hosts/*

All services with name ICMP (only fields current_state and plugin_output)

http://192.168.111.1/v1/*/local/services/ICMP/hosts/*?fields=current_state,plugin_output

Service ICMP for host SAP (all available fields - detail view)

http://192.168.111.1/v1/*/local/services/ICMP/hosts/SAP

Services of host EMail_Loop

http://192.168.111.1/v1/*/local/services/*/hosts/Email_Loop

...

checknow/{host_name}/{service_name}
Execute an active service check 'Agent-Status' on host '-azeti-A-' now
checknow/-azeti-A-/Agent-Status/

/addons

This resource offers the possiblity to upload and download files to/from /mnt/hd/daaz/addons/var and below

MethodResourceExampleDescription
GET/POSTaddons/addons/var/azeti/door_access.policyEither GET or POST the file

http://192.168.111.1:81/v1/*/local/servicesaddons/*var/hostsazeti/Email_Loop?fields=current_state,plugin_output

Acknowledge service Problem

http://192.168.111.1/v1/*/local/cmd/hosts/PDC/services/LDAP/ACKNOWLEDGE_SVC_PROBLEM/1/1/1/admin/Problem already known

Process Service Check-Result

http://192.168.111.1/v1/*/local/cmd/hosts/Google/services/Sleep60/PROCESS_SERVICE_CHECK_RESULT/0/OK - Example Result|val=10;20;30

Process active Service Check

http://192.168.111.1/v1/*/local/checknow/Google/http

 

Actions

List available actions

http://192.168.111.1/v1/*/local/actions/*

Display a specific action

http://192.168.111.1door_access.policy

/oscmd

These commands support arguments which must be defined in an escaped manner.

Info

Some commands require a file system path as argument which contains slashes, like '/mnt/hd/daaz/var/addons'. These slashes within the path must be given as backslashes, like '\mnt\hd\daaz\var\addons'. Some browser such as Googles Chrome will automatically turn any backslash into a slash.

Therefore try to specify backslashes as "%5C" if your browser does not allow backslashes.

Example

http://<IP>:81/v1/*/local/

...

Execute a specific action

http://192.168.111.1/v1/*/local/actions/OpenDoor/exec

OS Commands

Supported commands:

  • ls
  • traceroute
  • nslookup
  • type (display files installed in /mnt/hd/daaz/addons/var an below)
  • ping
  • check (service/hosts checks available in /sys/daaz/libexec)
  • df
  • ps (no arguments)

Restrictions

- Only available for user 'admin' - Only callable from within admin GUI (usually port 81) - Valid arguments characters: [a-zA-Z0-9\-\._\/]

Examples

...

oscmd/ls/-l/%5Cmnt%5Chd%5Cdaaz%5Cvar

Syntax

Code Block
/oscmd/{command}/argument_1/argument_2/

Available Commands

ResourceExample
/oscmd/ls
oscmd/ls/\flash\sysconfig

...

/

...

oscmd/traceroute
oscmd/traceroute/www.google.de

...

/

...

oscmd/nslookup
oscmd/check/nslookup/www.google.de

...

oscmd/type
oscmd/type/\azeti\door_access.policy

...

oscmd/ping
oscmd/ping/-c/3/www.google.de

...

oscmd/check
oscmd/check/check_icmp/-H/www.google.de

...

oscmd/check/check_icmp/-H/www.google.de/-v

...

oscmd/check/check_icmp/-H/www.google.de/-v/-v

...

oscmd/check/check_host/-H/www.google.de

...

oscmd/check/check_host/-H/www.google.de/-v

...

oscmd/check/check_host/-H/www.google.de/-v/-v

...

oscmd/df

...

AddOns

Upload/Download files to/from /mnt/hd/daaz/addons/var an below:

GET - Download POST - Upload

...

/-ah
Shows all free disk space human readable ('-ah')
oscmd/ps/web-monitorThis lists the processes and filters for 'web-monitor'
/usr/local/bin/ps auxww --cols=300 | grep web-monitor",

Additional Resources

Resource, ExamplesDescription
/comments
All comments
/appinfo
System information about the SONARPLEX device, including machine and monitor process information
/config/{config_object}
/config/hosts
/config/services
/config/contacts
/config/contactgroups
/config/commands

...

Listing of the monitoring configuration by object

 

/queue
Overview of the monitoring queue and the particular check scheduling