Difference between revisions of "LibreNMS - snmp extend mysql"

From wiki.1001solutions.net
(Created page with "Category:Post-It Verify that you have installed: <nowiki> apt install -y php-cli php-mysql</nowiki> = NginX LibreNMS script = Get the script: <nowiki> wget https:...")
 
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
  
Verify that you have installed:
+
'''Verify that you have php-mysql installed:'''
 +
<nowiki>
 +
dpkg -l | grep php-mysql</nowiki>
 +
 
 +
If needed, install it:
 
  <nowiki>
 
  <nowiki>
 
apt install -y php-cli php-mysql</nowiki>
 
apt install -y php-cli php-mysql</nowiki>
Line 9: Line 13:
  
  
= NginX LibreNMS script =
+
= MySQL LibreNMS script =
  
Get the script:
+
Get the script and make it executable:
 
  <nowiki>
 
  <nowiki>
wget https://github.com/librenms/librenms-agent/raw/master/snmp/mysql -O /etc/snmp/mysql</nowiki>
+
wget https://github.com/librenms/librenms-agent/raw/master/snmp/mysql -O /etc/snmp/mysql && chmod +x /etc/snmp/mysql</nowiki>
 
 
Unzip and copy it where you need. Make it executable.
 
  
 
Create the ''/var/cache/librenms'' directory and make sure that it is owned by the user running the SNMP daemon:
 
Create the ''/var/cache/librenms'' directory and make sure that it is owned by the user running the SNMP daemon:

Latest revision as of 09:31, 22 October 2020



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