安裝 PVE (Proxmox Virtual Environment) Agent 的方式

  • 在 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
如果 LibreNMS 無法正確呈現虛擬機網路流量圖, 出現 Error Drawing Graph 的訊息如下, 可能和 rrd 內 proxmox 目錄權限有關, 可以進入 LibreNMS 主機內執行 chown 修改目錄正確權限, Exp. 若正確權限應該為 librenms:librenms
chown -R librenms:librenms /opt/librenms/rrd/proxmox/



  1. 設定啟用 Proxmox graphs 服務
    /opt/librenms/config.php
    :
    $config['enable_proxmox'] = 1;
  2. 到 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
  3. 到 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
  4. 可以到 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
  5. 到 LibreNMS PVE 主機項目啟用 Application - Proxmox
  6. 再來就可以在 PVE 主機項目看到 app 的分頁
  • tech/librenms/checkpve.txt
  • 上一次變更: 2024/02/28 00:02
  • jonathan