DCNM Alarms Exporter is a Prometheus exporter that retrieves alarms from Cisco's Data Center Network Manager (DCNM) and exposes them as Prometheus metrics. This enables monitoring and alerting on DCNM alarms using Prometheus and its ecosystem.
- Exposes the total number of ongoing alarms as a Prometheus metric
- Exposes individual alarm metrics with alarm details as labels
- Automatically refreshes the DCNM authentication token
- Configurable token expiration time
- Go 1.16 or higher
- Access to a Cisco Data Center Network Manager (DCNM) instance
- A Prometheus server to scrape the exported metrics
- Clone the repository:
git clone https://github.com/geekxflood/dcnm-alarms-exporter.git
- Change to the project directory and build the binary:
cd dcnm-alarms-exporter
go build
- Set the following environment variables with the appropriate values for your DCNM instance:
export DCNM_URL=https://<dcnm-ip-or-hostname>:<port>
export DCNM_USERNAME=<your-username>
export DCNM_PASSWORD=<your-password>
export DCNM_EXPIRATION_TIME=<token-expiration-time-in-milliseconds>
Note: The DCNM_EXPIRATION_TIME should be greater than or equal to 5 minutes (300000 milliseconds).
- Run the exporter:
./dcnm-exporter
- Configure your Prometheus server to scrape the metrics from the exporter. Add the following lines to your prometheus.yml file:
scrape_configs:
- job_name: 'dcnm_alarms_exporter'
static_configs:
- targets: ['<exporter-ip-or-hostname>:9740']
Replace <exporter-ip-or-hostname>
with the IP address or hostname of the machine running the exporter.
- Reload your Prometheus configuration and start monitoring the DCNM alarms.
dcnm_ongoing_alarms
: Total number of ongoing alarmsdcnm_alarm
: Individual alarm metrics with the following labels:deviceName
deviceAttributes
message
lastScanTimeStamp
eventSwitch
eventType
description
severity