source: Extensions/Applications.md Applications ------------ You can use Application support to graph performance statistics from many applications. Different applications support a variety of ways collect data: by direct connection to the application, snmpd extend, or the agent. 1. [Apache](#apache) - SNMP extend 1. [BIND9/named](#bind9-aka-named) - Agent 1. [DHCP Stats](#dhcp-stats) - SNMP extend 1. [GPSD](#gpsd) - Agent 1. [Mailscanner](#mailscanner) - SNMP extend 1. [Memcached](#memcached) - SNMP extend 1. [MySQL](#mysql) - Agent 1. [NGINX](#nginx) - Agent 1. [NTP Client](#ntp-client) - SNMP extend 1. [NTP Server](#ntp-server) - SNMP extend 1. [OS Updates](#os-updates) - SNMP extend 1. [PowerDNS](#powerdns) - Agent 1. [PowerDNS Recursor](#powerdns-recursor) - Direct, Agent 1. [Proxmox](#proxmox) - SNMP extend 1. [Raspberry PI](#raspberry-pi) - SNMP extend 1. [TinyDNS/djbdns](#tinydns-aka-djbdns) - Agent 1. [Unbound](#unbound) - Agent 1. [UPS-nut](#ups-nut) - SNMP extend 1. [UPS-apcups](#ups-apcups) - SNMP extend 1. [Agent Setup](#agent-setup) ### Apache Either use SNMP extend or use the agent. ##### SNMP Extend 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 ``` 2. Make the script executable (chmod +x /etc/snmp/apache-stats.py) 3. Verify it is working by running /etc/snmp/apache-stats.py (In some cases urlgrabber needs to be installed, in Debian it can be achieved by: apt-get install python-urlgrabber) 4. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add: ``` extend apache /etc/snmp/apache-stats.py ``` 5. Restart snmpd on your host ##### Agent [Install the agent](#agent-setup) 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 (If you get error like "Can't locate LWP/Simple.pm". libwww-perl needs to be installed: apt-get install libwww-perl) 2. On the device page in Librenms, edit your host and check the `Apache` under the Applications tab. ### BIND9 aka named ##### Agent [Install the agent](#agent-setup) on this device if it isn't already and copy the `bind` script to `/usr/lib/check_mk_agent/local/` Create stats file with appropriate permissions: ```shell ~$ touch /etc/bind/named.stats ~$ chown bind:bind /etc/bind/named.stats ``` Change `user:group` to the user and group that's running bind/named. Bind/named configuration: ```text options { ... statistics-file "/etc/bind/named.stats"; zone-statistics yes; ... }; ``` Restart your bind9/named after changing the configuration. Verify that everything works by executing `rndc stats && cat /etc/bind/named.stats`. In case you get a `Permission Denied` error, make sure you chown'ed correctly. Note: if you change the path you will need to change the path in `scripts/agent-local/bind`. ### DHCP Stats A small shell script that reports current DHCP leases stats. ##### SNMP Extend 1. Copy the shell script to the desired host (the host must be added to LibreNMS devices) 2. Make the script executable (chmod +x /etc/snmp/dhcp-status.sh) 3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add: ``` extend dhcpstats /etc/snmp/dhcp-status.sh ``` 4. Restart snmpd on your host 5. On the device page in Librenms, edit your host and check the `DHCP Stats` under the Applications tab. ### GSPD A small shell script that reports GPSD status. ##### Agent [Install the agent](#agent-setup) on this device if it isn't already and copy the `gpsd` script to `/usr/lib/check_mk_agent/local/` You may need to configure `$server` or `$port`. Verify it is working by running `/usr/lib/check_mk_agent/local/gpsd` ### Mailscanner ##### SNMP Extend 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/mailscanner.php -O /etc/snmp/mailscanner.php ``` 2. Make the script executable (chmod +x /etc/snmp/mailscanner.php) 3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add: ``` extend mailscanner /etc/snmp/mailscanner.php ``` 4. Restart snmpd on your host 5. On the device page in Librenms, edit your host and check the `Mailscanner` under the Applications tab. ### Memcached ##### SNMP Extend 1. Copy the [memcached script](https://github.com/librenms/librenms-agent/blob/master/agent-local/memcached) to `/etc/snmp/` on your remote server. 2. Make the script executable: `chmod +x /etc/snmp/memcached` 3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add: ``` extend memcached /etc/snmp/memcached ``` 4. Restart snmpd on your host 5. On the device page in Librenms, edit your host and check `Memcached` under the Applications tab. ### MySQL ##### Agent [Install the agent](#agent-setup) on this device if it isn't already and copy the `mysql` script to `/usr/lib/check_mk_agent/local/` The MySQL script requires PHP-CLI and the PHP MySQL extension, so please verify those are installed. CentOS ``` yum install php-cli php-mysql ``` Debian ``` apt-get install php5-cli php5-mysql ``` Unlike most other scripts, the MySQL script requires a configuration file `/usr/lib/check_mk_agent/local/mysql.cnf` with following content: ```php