Notification - Listing

Parameters:

Limitations:

If you filter by service name, you will get results for all hosts, whether they have the specified service or not.

Example output:

{
 "list": [
   {
     "type": "1",              // 0=host, 1=service
     "name": "opsview::HTTP",  // For a service. Host would be "opsview"
     "time": "1234567890",     // Unix epoch seconds
     "output": "OK - localhost: rta 0.0.29ms lost 0%",

                               // Output for object at time of notification
     "state": "0",             // Possible values for host: 0=up, 1=down, 2=unreachable

                               // For services: 0=ok, 1=warning, 2=critical, 3=unknown
     "notificationtype": "0",  // 0=NORMAL, 1=ACKNOWLEDGEMENT, 2=FLAPPINGSTART, 3=FLAPPINGSTOP, 4=FLAPPINGDISABLED, 5=DOWNTIMESTART, 6=DOWNTIMEEND, 7=DOWNTIMECANCELLED, 8=CUSTOM
     "profiles": [
        {
          "name": "Personal profile",
          "users": [ "alex" ], // This will only be one entry, but in future for BSM, maybe multiple
          "nm": [ "1", "3" ],  // Notification methods used for this notification. See key for the notification methods
        },
        {
          "name": "Some shared notification profile",
          "users": [ "cbalsdon" ],
          "nm": [ "1", "4", "5" ]
        },
        {
          "name": "Some shared notification profile",
                              // This is same as above profile, but cannot be collapsed yet. This may change in future
          "users" : [ "smarsh", "alex" ],
          "nm" : [ "1", "4", "5" ]
        }
     ]
   }
 ],
 "nms": {      // Key of notification methods
   "1": "com.opsview.notificationmethods.aql",
   "2": "com.opsview.notificationmethods.email",
   "3": "com.opsview.notificationmethods.pagerduty",
   "4": "com.opsview.notificationmethods.smsgateway",
   "5": "custom",
 },
 "summary": {
   "total":"150"  // Total number of records used
 }
}
["Opsview On-premises"] ["API", "Technical Reference"]

Was this topic helpful?