Skip to content

Apache

Either use SNMP extend or use the agent.

Note

That you need to install and configure the Apache mod_status module before trying the script.

  1. Download the script onto the desired host (the host must be added to LibreNMS devices)
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/apache-stats.py -O /etc/snmp/apache-stats.py
  1. Make the script executable
chmod +x /etc/snmp/apache-stats.py
  1. Create the cache directory, '/var/cache/librenms/' and make sure that it is owned by the user running the SNMP daemon.
mkdir -p /var/cache/librenms/
  1. Verify it is working by running /etc/snmp/apache-stats.py Package urllib3 for python3 needs to be installed. In Debian-based systems for example you can achieve this by issuing:
apt-get install python3-urllib3
  1. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
extend apache /etc/snmp/apache-stats.py
  1. Restart snmpd on your host
sudo systemctl snmpd restart
  1. Test by running
snmpwalk <various options depending on your setup> localhost NET-SNMP-EXTEND-MIB::nsExtendOutput2Table

Install prerequisites

apt-get install libwww-perl

install agent

Install the agent) on this device if it isn't already and copy the apache script to /usr/lib/check_mk_agent/local/

  1. Verify it is working by running /usr/lib/check_mk_agent/local/apache

  2. Create the cache directory, '/var/cache/librenms/' and make sure that it is owned by the user running the SNMP daemon.

    mkdir -p /var/cache/librenms/
    
  3. On the device page in Librenms, edit your host and check the Apache under the Applications tab.