Artica Wiki

Integrate ActiveDebianSync with monitoring tools

How to monitor with Zabbix, Prometheus, Nagios/Icinga

How to monitor with Zabbix, Prometheus, Nagios/Icinga

Prometheus

Create an export called `/api/status` :

curl -s http://127.0.0.1:9090/api/status  jq -r '.sync_stats | "activedebiansync_total_files \(.total_files)\nactivedebiansync_total_bytes \(.total_bytes)\nactivedebiansync_failed_files \(.failed_files)"'
 

Nagios/Icinga

#!/bin/bash
STATUS=$(curl -s http://127.0.0.1:9090/api/health | jq -r '.status')
if [ "$STATUS" = "healthy" ]; then
        echo "OK - ActiveDebianSync is running"
        exit 0
else
        echo "CRITICAL - ActiveDebianSync is not healthy"
        exit 2
fi

Zabbix

Item type: HTTP agent
URL: `http://127.0.0.1:9090/api/status`
JSON path: `$.status`