安裝 PVE (Proxmox Virtual Environment) Agent 的方式
- 這是 SNMP Extend
- PVE 8.2
設定程序
- 在 PVE 主機內安裝
apt install libpve-apiclient-perl sudo wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox chmod +x /usr/local/bin/proxmox
驗證是否 proxmox 可以執行成功
/usr/local/bin/proxmox
如果成功, 訊息大概如下
<<<app-proxmox>>> ichiayi 150/net0/41767121023/13142822510/pve-web 114/net0/51309302/1320903/ct-squid 102/net0/1177249044/152864074/ct-librenms 151/net0/289515730/48903723/pve-rclone 105/net0/119115961/41527973/ct-lintsainms 104/net0/57595404/16205888/ct-opensvn 300/net0/149680919/6077617552/pve-omvnas 152/net0/94636075/77614449/pve-ms
- 修改 sudo 設定檔
- /etc/sudoers.d/proxmox
# Cmnd alias specification Debian-snmp ALL=(ALL) NOPASSWD: /usr/local/bin/proxmox
- 修改 snmpd 設定
vi /etc/snmp/snmpd.conf
: extend proxmox /usr/bin/sudo -S /usr/local/bin/proxmox
重新啟動 snmpd
systemctl restart snmpd
以下 Agent 方式
- 設定啟用 Proxmox graphs 服務
- /opt/librenms/config.php
: $config['enable_proxmox'] = 1;
- 到 PVE 主機內安裝 LibreNMS-agent
apt-get install sudo wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox chmod +x /usr/local/bin/proxmox
root@nuc:~# wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox root@nuc:~# chmod +x /usr/local/bin/proxmox root@nuc:~# /usr/local/bin/proxmox <<<app-proxmox>>> ichiayi 101/net0/29668379094/23170850421/ct-nginx 100/net0/400463176/419993817/ct-dns 102/net0/4163593470/607305547/ct-librenms 110/net0/2244130024/55138419532/ct-percona1 109/net0/308085467/1447916733/ct-wiki 150/net0/73151529314/29696018346/pve-web 106/net0/214723565/83403063/ct-lintsaiweb
- 到 PVE 主機內修改 sudo 與 snmpd 設定檔並重起 snmpd
- /etc/sudoers
: # Cmnd alias specification Debian-snmp ALL=(ALL) NOPASSWD: /usr/local/bin/proxmox :
- /etc/snmp/snmpd.conf
: extend proxmox /usr/bin/sudo /usr/local/bin/proxmox
systemctl restart snmpd
- 可以到 LibreNMS 主機內透過 snmpwalk 來驗證是否 PVE 主機內的 snmpd 設定正確 Exp.
snmpwalk -v2c -c public 192.168.11.251 NET-SNMP-EXTEND-MIB::nsExtendOutput2Table
[root@ct-librenms ~]# snmpwalk -v2c -c public 192.168.11.251 NET-SNMP-EXTEND-MIB::nsExtendOutput2Table NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".1 = STRING: <<<app-proxmox>>> NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".2 = STRING: ichiayi NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".3 = STRING: 102/net0/4241011585/647317502/ct-librenms NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".4 = STRING: 100/net0/407111768/428085231/ct-dns NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".5 = STRING: 101/net0/30300045476/23709106512/ct-nginx NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".6 = STRING: 109/net0/314060232/1478347985/ct-wiki NET-SNMP-EXTEND-MIB::nsExtendOutLine."proxmox".7 = STRING: 110/net0/2297059626/55966461864/ct-percona1