snmp從windows server 2012 開始就被棄用
最近剛好看到 ncpa
nagios 出的工具
記錄一下安裝使用流程 被監控端以windows 為例
下載 windows agent 安裝
安裝過程中 token 記得要修改
監控端下載 check_ncpa.py
撈取被控端資料語法如下
# 1. 檢查 CPU 使用率 (5分鐘平均)
python3 check_ncpa.py -H 192.168.1.100 -t 'mytoken' -M 'cpu/percent' -q "aggregate=avg" -w 80 -c 90
# 2. 檢查記憶體使用率 (%)
python3 check_ncpa.py -H 192.168.1.100 -t 'mytoken' -M 'memory/virtual/percent' -w 80 -c 90
# 3. 檢查根目錄 / (Linux) 或 C: 磁碟空間 (Windows)
# Linux:
python3 check_ncpa.py -H 192.168.1.100 -t 'mytoken' -M 'disk/logical/|/percent' -w 80 -c 90
# Windows:
python3 check_ncpa.py -H 192.168.1.100 -t mytoken -M disk/logical/C:\|/used_percent -w 80 -c 90
查看所有可撈的指標
python3 check_ncpa.py -H 192.168.1.100 -t 'mytoken' -M 'disk/logical/C:|'
https://www.nagios.org/projects/ncpa/
https://assets.nagios.com/downloads/ncpa3/
https://github.com/NagiosEnterprises/ncpa/tree/master
https://github.com/NagiosEnterprises/ncpa/tree/master/client
沒有留言:
張貼留言