Portactivity
Portactivity
SNMP Extend
-
Install missing packages - Ubuntu is shown below.
apt install libparse-netstat-perl apt install libjson-perl -
Copy the Perl script to the desired host (the host must be added to LibreNMS devices)
wget https://github.com/librenms/librenms-agent/raw/master/snmp/portactivity -O /etc/snmp/portactivity -
Make the script executable.
chmod +x /etc/snmp/portactivity -
Edit your
snmpd.conffile (usually/etc/snmp/snmpd.conf) and add:extend portactivity /etc/snmp/portactivity -p http,ldap,imap
portactivity
It monitors HTTP, LDAP, and IMAP. The -p switch gives the ports in a comma separated list.
These names must be in /etc/services or in the source of NSS. Without them, the script gives an error.
If you want to JSON returned by it to be printed in a pretty format use the -P flag.
-
Restart snmpd on your host.
sudo systemctl restart snmpd
Note: only TCP[46] services are supported.