LibreNMS - snmp extend php-fpm: Difference between revisions

From Wiki.IT-Arts.net
imported>Z
(Created page with "Category:Post-It = NginX LibreNMS script = Get the script: <nowiki> wget https://github.com/librenms/librenms-agent/raw/master/snmp/phpfpmsp -O /etc/snmp/phpfpmsp</no...")
 
imported>Z
No edit summary
Line 21: Line 21:
Adapt your ''/etc/sudoers'' with:
Adapt your ''/etc/sudoers'' with:
  <nowiki>
  <nowiki>
Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/fail2ban</nowiki>
Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/phpfpmsp</nowiki>




Line 29: Line 29:
Adapt your ''/etc/snmp/snmpd.conf'' with:
Adapt your ''/etc/snmp/snmpd.conf'' with:
  <nowiki>
  <nowiki>
extend fail2ban /usr/bin/sudo /etc/snmp/fail2ban -c -U</nowiki>
extend phpfpmsp /usr/bin/sudo /etc/snmp/phpfpmsp</nowiki>
Restart the service.
Restart the service.
= Crontab =
Add to the crontab:
<nowiki>
*/3    *    *    *    *    root    /etc/snmp/fail2ban -u</nowiki>




Line 46: Line 38:
Adapt the user and path to your configuration:
Adapt the user and path to your configuration:
  <nowiki>
  <nowiki>
sudo -u Debian-snmp /etc/snmp/fail2ban</nowiki>
sudo -u Debian-snmp /etc/snmp/phpfpmsp</nowiki>
 
In case of bug with the Perl @NIC, execute:
<nowiki>
cpan JSON</nowiki>




Line 56: Line 44:
= Sources =
= Sources =


* https://docs.librenms.org/Extensions/Applications/#fail2ban
* https://docs.librenms.org/Extensions/Applications/#php-fpm






----
----

Revision as of 11:08, 1 May 2020



NginX LibreNMS script

Get the script:

wget https://github.com/librenms/librenms-agent/raw/master/snmp/phpfpmsp -O /etc/snmp/phpfpmsp

Unzip and copy it where you need. Make it executable.

Adapt:

url="http://127.0.0.1/status?full"


sudo Configuration

Adapt your /etc/sudoers with:

Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/phpfpmsp


SNMP Configuration

Adapt your /etc/snmp/snmpd.conf with:

extend phpfpmsp /usr/bin/sudo /etc/snmp/phpfpmsp

Restart the service.


Check Command

Adapt the user and path to your configuration:

sudo -u Debian-snmp /etc/snmp/phpfpmsp


Sources