Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

URLhttps://123.123.123.123/services/index.json?angular=true

Methode: GET

Response: JSON


Query Parameters:

Possible get parameter to get a filtered service list via REST API
"angular": true,
"direction": "desc",
"page": 1,
"scroll": true,
"sort": "Servicestatus.current_state",
"filter[Host.id]": null,
"filter[Host.name]": null,
"filter[Service.keywords][]": "keyword1",
"filter[Service.keywords][]": "keyword2",
"filter[Service.servicename]": null,
"filter[Servicestatus.active_checks_enabled]": null,
"filter[Servicestatus.current_state][]": "ok",
"filter[Servicestatus.current_state][]": "warning",
"filter[Servicestatus.current_state][]": "critical",
"filter[Servicestatus.current_state][]": "unknown",
"filter[Servicestatus.output]": null,
"filter[Servicestatus.problem_has_been_acknowledged]": null,
"filter[Servicestatus.scheduled_downtime_depth]": null,

Find services by name

URLhttps://123.123.123.123/services/index.json?angular=true&filter[Service.servicename]=ping

Methode: GET

Response: JSON

Response
{  
   "all_services":[
      {  
         "Service":{  
            "id":"11",
            "uuid":"bb8c6680-8875-460a-a8a5-9e4a5d6bb01b",
            "servicename":"Ping",
            "description":null,
            "active_checks_enabled":true,
            "tags":null,
            "host_id":4,
            "allow_edit":true,
            "disabled":false,
            "has_graph":true
         },
         "Host":{  
            "id":"4",
            "uuid":"5c67a508-787d-4139-9aff-bb7f2de0199e",
            "hostname":"cloud.oitc.demo",
            "address":"192.168.46.4",
            "description":null,
            "active_checks_enabled":null,
            "satelliteId":0,
            "containerId":null,
            "containerIds":[  
               "1"
            ],
            "tags":null,
            "allow_edit":true,
            "is_satellite_host":false
         },
         "Servicestatus":{  
            "currentState":0,
            "lastHardState":null,
            "isFlapping":false,
            "problemHasBeenAcknowledged":false,
            "scheduledDowntimeDepth":0,
            "lastCheck":"11:33:40 - 24.10.2018",
            "nextCheck":"11:38:40 - 24.10.2018",
            "activeChecksEnabled":"1",
            "lastHardStateChange":"12:44:48 - 11.01.2018",
            "last_state_change":"12:44:48 - 11.01.2018",
            "processPerformanceData":null,
            "state_type":"1",
            "acknowledgement_type":0,
            "flap_detection_enabled":null,
            "notifications_enabled":null,
            "current_check_attempt":null,
            "output":"PING OK - Packet loss = 0%, RTA = 0.62 ms",
            "long_output":null,
            "perfdata":null,
            "latency":null,
            "max_check_attempts":null,
            "isHardstate":true,
            "isInMonitoring":true
         },
         "Hoststatus":{  
            "currentState":0,
            "isFlapping":false,
            "problemHasBeenAcknowledged":false,
            "scheduledDowntimeDepth":null,
            "lastCheck":"",
            "nextCheck":"",
            "activeChecksEnabled":null,
            "lastHardStateChange":"12:40:38 - 11.01.2018",
            "last_state_change":"",
            "output":null,
            "long_output":null,
            "acknowledgement_type":null,
            "state_type":null,
            "flap_detection_enabled":null,
            "notifications_enabled":null,
            "current_check_attempt":null,
            "max_check_attempts":null,
            "latency":null,
            "isHardstate":false,
            "isInMonitoring":true
         }
      }
   ],
   "scroll":{  
      "page":1,
      "limit":25,
      "offset":25,
      "hasPrevPage":false,
      "prevPage":1,
      "nextPage":2,
      "current":1,
      "hasNextPage":false
   }
}


Find services by host name

URL: https://123.123.123.123/services/index.json?angular=true&filter[Host.name]=ansible

Methode: GET

Response: JSON

Same response as shown above.


Find services by state

URL: https://123.123.123.123/services/index.json?angular=true&filter[Servicestatus.current_state][]=warning&filter[Servicestatus.current_state][]=critical&filter[Servicestatus.problem_has_been_acknowledged]=true

Methode: GET

Request parameters:

Example parameter to get all warning, critical and acknowledged services
"angular": true,
"filter[Servicestatus.current_state][]": ["warning"],
"filter[Servicestatus.current_state][]": ["critical"],
"filter[Servicestatus.problem_has_been_acknowledged]": true,

Response: JSON

Same response as shown above.




  • Keine Stichwörter