ehrnst / System-Center-Operations-Manager-API

Microsoft System Center Operations Manager (SCOM) Web API
http://adatum.no/operationsmanager/web-api-for-scom
MIT License
41 stars 7 forks source link

Alerts of Monitoring Object #23

Closed MarkPort closed 3 years ago

MarkPort commented 6 years ago

Hello,

I am trying to get the alerts of my monitoring object via HTTP GET request to:

http://scomapi/api/alerts/MonitoringObject/{MonitoringObjectGUID}

The {MonitoringObjectGUID} I got with PowerShell:

Get-SCOMMonitoringObject -DisplayName "MY OBJECT" | select id

Unfortunately the response is "[]", although in the Operation Manager I can see alerts in that object.

ehrnst commented 6 years ago

Hi thanks for the feedback. Are you sure that the ID you are using is the actual alerting object, and not a hosted object?

Hard to diagnose this over github. I'm off work atm. But will have a look next week if you haven't figured it out by then.

Martin

ehrnst commented 6 years ago

Hi Mark. I'm not able to reproduce your error. See if you can list all alerts from the api and get the objectId from there. Test it against the monitoringObject alert endpoint