How to activate Proxmox VM guest traffic graphs using LibreNMS

LibreNMS is an incredibly powerful open source Network Management System (NMS) tool made with Laravel. Packed in it’s punch is its ability to read Proxmox servers and automatically display traffic usage for each guest VM.

The LibreNMS documentation is exceptional – very much a system administrator’s dream and on par with other magnificent Laravel documentation.

We’ve taken the best from their documentation about Proxmox and summarized it in this article.

When setting up a new Proxmox server with LibreNMS there is a Proxmox server component, and a LibreNMS component.

On the LibreNMS Server

Skip this step if you’ve already done this once in your cluster.

From https://docs.librenms.org/Extensions/Proxmox/

$config['enable_proxmox'] = 1;
cp /opt/librenms-agent/agent-local/proxmox /usr/lib/check_mk_agent/local/proxmox
chmod +x /usr/lib/check_mk_agent/local/proxmox
cp /opt/librenms-agent/[email protected] /opt/librenms-agent/check_mk.socket /etc/systemd/system
systemctl daemon-reload
systemctl enable check_mk.socket && systemctl start check_mk.socket

On the Proxmox Server

SNMP

Proxmox doesn’t have SNMP installed by default, so you’ll need that. Below we install snmpd, backup the super verbose default file, and create our own minimalist one.

apt -y install snmpd
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.backup

cat <<EOF > /etc/snmp/snmpd.conf
rocommunity secret 1.2.3.4

syslocation geography

agentAddress udp:161

dontLogTCPWrappersConnects yes

EOF

service snmpd restart

LibreNMS Perl Library for Proxmox VE Hypervisors

From https://docs.librenms.org/Extensions/Applications/#proxmox

Install the following Perl library:

wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox
chmod +x /usr/local/bin/proxmox
echo extend proxmox /usr/local/bin/proxmox >> /etc/snmp/snmpd.conf
service snmpd restart

On a cluster

apt -y install sudo

cat <<EOF > /etc/sudoers.d/snmp
Debian-snmp ALL=(ALL) NOPASSWD: /usr/local/bin/proxmox
EOF

service snmpd restart

Using the LibreNMS UI

Activate the librenms-agent and proxmox application flag for the device you are monitoring. In my instance, Proxmox is automatically detected.

Now a new menu will appear called “Apps” that shows you each VM guest’s usage.

Issues

Proxmox(cfs-lock ‘authkey’ error: pve cluster filesystem not online.)

On a cluster you may experience this problem. Follow the cluster instructions above or follow the advice below in this Reddit post about adding an API key:

Source: https://www.reddit.com/r/LibreNMS/comments/xxyz85/proxmox_application_for_librenms/

Proxmox(403 Permission check failed (/, Sys.Audit))

This could be because you don’t have the correct API permission.

On my system I had to turn off privilege separation.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top