Check Event Payload in Servicenow from Monitoring Tool

Sravani36
Tera Expert

Hi All,

 

When an event is triggered by the monitoring tool, and If they are directly using our event table APIs, how to check the payload of it? because some test event has been triggered but all the values are showing blank in the event, so has to check the payload. 

 

Thank you

 

6 REPLIES 6

pratiksha5
Mega Sage

Use rest API Explorer or Postman and try to give the same payload. It will give you some idea. 

 

Rahul Priyadars
Giga Sage
Giga Sage

See if this helps you ...for simulation you can even use REST API EXPLORER..

Sample Payload 

==========

{
"source":"Postman",
"node":"linuxserver2",
"type":"Host down",
"resource":"Host Down",
"metric_name":"Host Unavaiability",
"severity":"Critical",
"description":"Host Event:-linux server linuxserver2 down"
}

==========

Payload Sent and Event Created in Event Table 

RahulPriyadars_0-1686117188927.png

 

Actual Event record Created

 

RahulPriyadars_2-1686117421545.png

 

RahulPriyadars_1-1686117229238.png

Now You can ask Source System (Monitoring Tool admin) to give you the PAYLOAD which they are sending to Service Now.

 

Also You can check Logs for Incoming Payload Data

https://www.servicenow.com/community/developer-articles/how-to-capture-the-inbound-rest-logs-and-the...

 

Regards

RP

 

Hi Rahul,

 

This is how the payload looks from Grafana. And I could see the below error, is this because of missing details or not a valid JSON?

 

{{ definition "Servicenow" }} { "event_type": "{{.RuleName}}", "severity": "{{if .IsAlert}}{{if eq . State "alert"}}critical{{else}}warning{{end}}{{else}}info{{end}}", "description": "{{.Message}}", "source": "Grafana", "timestamp": "{{.Time}}", "additional_info": { "dashboard": "{{.DashboardLink}}", "panel": "{{.PanelTitle}}", "image": "{{.ImageURL}}" }, "tags": [ {{range .Tags}} "{{.}}", {{end}} ] } {{ end }}

 

Error

{
  "error": {
    "message": "Exception while reading request",
    "detail": "The payload is not valid JSON."
  },
  "status": "failure"
}

 

Thank you

what is the End Point Graphana is Consuming?

 

Above Payload seems bit weired.

 

https://docs.servicenow.com/en-US/bundle/utah-it-operations-management/page/product/event-management...

 

Regards

RP