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.conf
file (usually/etc/snmp/snmpd.conf
) and add:extend portactivity /etc/snmp/portactivity -p http,ldap,imap
portactivity
Will monitor HTTP, LDAP, and IMAP. The -p
switch specifies what ports to use. This is a comma seperated list.
These must be found in '/etc/services' or where ever NSS is set to fetch it from. If not, it will throw 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
Please note that for only TCP[46] services are supported.