Create sample event using REST API by passing JSON

Vinay Noel
Tera Contributor

Hi Community,

 

We are in need to mimic creation of event from an external application as the connection is not setup to our SN instance from the external application yet.

 

The requirement is to test the Push connector listener script after making some script changes.

We are planning to pass the input event attributes to SN instance as JSON format using REST.

 

Please suggest some ways of passing the JSON input attributes to SN and eventually get the event created after the listener script work its process on the input.

 

sample JSON would look like this -

{
   "source":"SCOM",
   "event_class":"SCOM 2007 on scom.server.com",
   "resource":"C:",
   "node":"name.of.node.com",
   "metric_name":"Percentage Logical Disk Free Space",
   "type":"Disk space",
   "severity":"4",
   "description":"The disk C: on computer V-W2K8-dfg.dfg.com is running out of disk space. The value that exceeded the threshold is 41% free space.",
   "additional_info": '{"scom-severity":"Medium","metric-value":"38","os_type":"Windows.Server.2008"}'
  } 

 

Thanks in Advance

7 REPLIES 7

Were you able to figure this one out? If you can still remember, do you mind sharing how you did it? Thanks!

Hey there @JamieC504615231 ,

 

I used an extension in chrome browser called Boomerang. 

The Post method was selected and the correct endpoint was supplied along with the JSON request.

 

Do try it out. 

 

Thanks,

Vinay

Jeff K1
Kilo Guru

There are a lot of ways to send events via the API.

Postman is a popular tool for passing JSON. We used that for years, but in recent years it's had some data and privacy issues. We've switched to Keyrunner for now.

I've also written a PowerShell script when I was trying to simulate what one of our customers would be working with.