Alarms are notifications that are activated in response to an event, a set of conditions, or the state of an object. Alarms, along with other alerts, are displayed on the NSX Dashboard and other screens on the vSphere Web Client UI.
You can use the GET api/2.0/services/systemalarms API to view alarms on NSX objects.
NSX supports two methods for an alarm:
- Alarm corresponds to a system event and has an associated resolver that will attempt to resolve the issue that triggers the alarm. This approach is designed for network and security fabric deployment (for example, EAM, Message Bus, Deployment Plug-In), and is also supported by Service Composer. These alarms use the event code as the alarm code. For more details, refer to NSX Logging and System Events document.
- Edge notifications alarms are structured as a triggering and resolving alarm pair. This method is supported by several Edge functions, including IPSec VPN, load balancer, high availability, health check, edge file system, and resource reservation. These alarms use a unique alarm code which is not the same as the event code. For more details, refer to NSX Logging and System Events document.
Generally, an alarm gets automatically deleted by the system when the error condition is rectified. Some alarms are not auto cleared on a configuration update. Once the issue is resolved, you have to clear the alarms manually.
Here is an example of the API that you can use to clear the alarms.
GET https://<<NSX-IP>>/api/2.0/services/alarms/{sourceId}
Resolve all alarms for a source by sourceId:
POST https://<<NSX-IP>>/api/2.0/services/alarms/{sourceId}?action=resolve
You can view NSX alarms, including Message Bus, Deployment Plug-In, Service Composer, and Edge alarms:
GET https://<<NSX-IP>>/api/2.0/services/systemalarms
You can view a specific NSX alarm by alarmId:
GET https://<<NSX-IP>>/api/2.0/services/systemalarms/<alarmId>You can resolve a specific NSX alarm by alarmId:
POST https://<<NSX-IP>>/api/2.0/services/systemalarms/<alarmId>?action=resolve
For more information on API, refer to NSX API Guide.