ONTAP Rest API Discussions

ONTAP health via REST API

KarelBP
4,360 Views

Hi,

I'd like to ask if anybody knows which is the correct URI to get health of an ONTAP system. If I login to GUI, I see "All systems are healthy". Which URI would tell me that?

 

Why I'm asking: I have a script which checks our E-Series storages every 15 minutes and there's a value "Optimal" or "Needs attention". This is enough to create a ticket to the technical team to check what's going on + some additional info where I pull which part of it went wrong, but no details. We don't need to filter tons of events and still get a ticket open, somebody looks at it. I'd like to get this simple script for the ONTAPs too.

 

Thanks,

Karel

 

 

1 ACCEPTED SOLUTION

mbeattie
4,267 Views

Hi Karel,

 

Rather than connecting to each cluster to check the health status in your script individually have you considered querying AIQUM for all datasources (ONTAP Clusters) assuming you are using Active IQ (OCUM)

 

What programming language are you developing in? If you are using PowerShell check out this module i've developed which is for Active IQ 9.7.

 

https://github.com/matthew-beattie/AIQUM/blob/master/AIQUM.psm1

 

See the function "Get-UMDatasource" (if your using another programming language you can atleast see the URI's in the code). AIQUM contains the clusters health status for each cluster and is automatically re-discovered every 15 minutes. Some other properties to monitor would be the last discovery time (EG if it's much more than 15 minutes then there is a communication issue between AIQUM and ONTAP and that should be investigated). The REST API shows expiring licenses etc so there is some useful information there if you are developing a health check. I have some powershell code which will does a basic health check on that if you are interested?

 

Hope that gives you some ideas.

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

5 REPLIES 5

mbeattie
4,268 Views

Hi Karel,

 

Rather than connecting to each cluster to check the health status in your script individually have you considered querying AIQUM for all datasources (ONTAP Clusters) assuming you are using Active IQ (OCUM)

 

What programming language are you developing in? If you are using PowerShell check out this module i've developed which is for Active IQ 9.7.

 

https://github.com/matthew-beattie/AIQUM/blob/master/AIQUM.psm1

 

See the function "Get-UMDatasource" (if your using another programming language you can atleast see the URI's in the code). AIQUM contains the clusters health status for each cluster and is automatically re-discovered every 15 minutes. Some other properties to monitor would be the last discovery time (EG if it's much more than 15 minutes then there is a communication issue between AIQUM and ONTAP and that should be investigated). The REST API shows expiring licenses etc so there is some useful information there if you are developing a health check. I have some powershell code which will does a basic health check on that if you are interested?

 

Hope that gives you some ideas.

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

KarelBP
4,224 Views

Oh yes, of course! I just didn't I think about it.

 

Thanks for the hint. I actually pull this info from SANtricity Unified Manager for the E-Series, I can do the same with ActiveIQ Unified Manager for the ONTAPs.

 

A simple GET call to "/api/admin/datasources/clusters" on ActiveIQ Unified Manager and it's all right there in the answer, name and cluster_health_status, basically the same as I'm getting with "/devmgr/v2/storage-systems" from SANtricity Unified Manager in name and status values. Now I need to identify equivalent of /devmgr/v2/storage-systems/<systemID>/failures?details=false" and I can reuse my script as it is.

 

Thanks, thanks a lot.

Karel

KarelBP
4,177 Views

Hi Matt,

I've read thru your scripts. In command Get-UMEventID you're calling https://$Server/api/management-server/events/$EventID. This seems to be an undocumented function of the API. Is there a way to get a complete list of all events somehow? I didn't find it anywhere.

 

Thanks,

Karel

 

mbeattie
4,142 Views

Hi Karel,

 

I used a chrome plugin called WebSpy to view the REST API's whilst invoking actions in the Web UI. The default URI for events is:

 

https://<%hostname%>/api/management-server/events?filter=impact_level,eq,Risk%7CIncident&filter=event_state,eq,NEW%7CACKNOWLEDGED&filter=triggered_tim...

 

If you didn't want any filters and just list all events i guess you could use:

https://<%hostname%>/api/management-server/events

 

Note: Private API's not documented in the Swagger UI may change in future

 

Hope that helps

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

KarelBP
4,123 Views

Hi,

Thanks for the tip, I tried to install the same plugin, it shows various parameters depending how I set filters in the UI. What is interesting to me is that the links copied out of the UI with WebSpy plugin don't always work if called from PowerShell. I'm getting Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error. If there's a number of an event in the URI, then it works. If I remove it or add filter parameters, I'm getting error 500.  I've tried it on the VMware appliance and on Windows installation version 9.7, same behavior. 

 

Never mind, it's not an officially published function, I'll sit and wait for next version of the AIQUM. Or maybe I'll go bugging our account manager with a feature request.

 

Thanks,

Karel

 

Public