LibreNMS - snmp extend mysql: Difference between revisions
From IT-Arts.net
m Text replacement - "Category:Post-It" to "Category:Wiki" |
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' " |
||
| Line 1: | Line 1: | ||
[[Category:Wiki]] | [[Category:Wiki]] | ||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
Latest revision as of 08:55, 17 January 2026
Verify that you have php-mysql installed:
dpkg -l | grep php-mysql
If needed, install it:
apt install -y php-cli php-mysql
MySQL LibreNMS script
Get the script and make it executable:
wget https://github.com/librenms/librenms-agent/raw/master/snmp/mysql -O /etc/snmp/mysql && chmod +x /etc/snmp/mysql
Create the /var/cache/librenms directory and make sure that it is owned by the user running the SNMP daemon:
mkdir -p /var/cache/librenms/ && chown -R Debian-snmp:Debian-snmp /var/cache/librenms
Create /etc/snmp/mysql.cnf:
<?php $mysql_user = 'root'; $mysql_pass = 'toor'; $mysql_host = 'localhost'; $mysql_port = 3306;
SNMP Configuration
Adapt your /etc/snmp/snmpd.conf with:
extend mysql /etc/snmp/mysql
Restart the service.
Check Command
Adapt the user and path to your configuration:
sudo -u Debian-snmp /etc/snmp/mysql
Sources
