2021-07-10 03:34:01 +08:00
# Applications
2016-07-26 21:27:12 -05:00
2019-07-06 10:51:27 -05:00
You can use Application support to graph performance statistics of
many applications.
2022-02-09 00:02:28 +01:00
Different applications support a variety of ways to collect data:
1. By direct connection to the application
2. snmpd extend
3. [The agent ](Agent-Setup.md ).
The monitoring of applications could be added
2019-07-06 10:51:27 -05:00
before or after the hosts have been added to LibreNMS.
2018-05-09 02:15:58 +02:00
2018-05-14 13:33:29 -04:00
If multiple methods of collection are listed you only need to enable one.
2019-07-06 10:51:27 -05:00
## SNMP Extend
When using the snmp extend method, the application discovery module
will pick up which applications you have set up for monitoring
automatically, even if the device is already in LibreNMS. The
application discovery module is enabled by default for most \*nix
operating systems, but in some cases you will need to manually enable
the application discovery module.
### SUDO
2019-09-02 22:08:05 +02:00
One major thing to keep in mind when using SNMP extend is these run as the snmpd
user that can be an unprivileged user. In these situations you need to use sudo.
2019-07-06 10:51:27 -05:00
2019-09-02 22:08:05 +02:00
To test if you need sudo, first check the user snmpd is running as.
Then test if you can run the extend script as that user without issue.
For example if snmpd is running as 'Debian-snmp' and we want
to run the extend for proxmox, we check that the following run without error:
2019-07-06 10:51:27 -05:00
2019-09-02 22:08:05 +02:00
```
2020-06-22 12:34:25 +02:00
sudo -u Debian-snmp /usr/local/bin/proxmox
2019-09-02 22:08:05 +02:00
```
If it doesn't work, then you will need to use sudo with the extend command.
For the example above, that would mean adding the line below to the sudoers file:
2019-07-06 10:51:27 -05:00
```
Debian-snmp ALL = NOPASSWD: /usr/local/bin/proxmox
```
2018-05-09 02:15:58 +02:00
2019-09-02 22:08:05 +02:00
Finally we would need to add sudo to the extend command, which would look
like that for proxmox:
2018-05-09 02:15:58 +02:00
2019-07-06 10:51:27 -05:00
```
extend proxmox /usr/bin/sudo /usr/local/bin/proxmox
```
## Enable the application discovery module
2018-05-09 02:15:58 +02:00
1. Edit the device for which you want to add this support
2019-07-06 10:51:27 -05:00
1. Click on the * Modules * tab and enable the `applications` module.
1. This will be automatically saved, and you should get a green
confirmation pop-up message.
2018-05-09 02:15:58 +02:00

2019-07-06 10:51:27 -05:00
After you have enabled the application module, it would be wise to
then also enable which applications you want to monitor, in the rare
case where LibreNMS does not automatically detect it.
2018-05-09 02:15:58 +02:00
2019-07-06 10:51:27 -05:00
**Note**: Only do this if an application was not auto-discovered by
LibreNMS during discovery and polling.
2018-05-09 02:15:58 +02:00
2019-07-06 10:51:27 -05:00
## Enable the application(s) to be discovered
2018-05-09 02:15:58 +02:00
1. Go to the device you have just enabled the application module for.
2019-07-06 10:51:27 -05:00
1. Click on the * Applications * tab and select the applications you
want to monitor.
1. This will also be automatically saved, and you should get a green
confirmation pop-up message.
2018-05-09 02:15:58 +02:00

2019-07-06 10:51:27 -05:00
## Agent
2018-05-09 02:15:58 +02:00
2019-07-06 10:51:27 -05:00
The unix-agent does not have a discovery module, only a poller
module. That poller module is always disabled by default. It needs to
be manually enabled if using the agent. Some applications will be
automatically enabled by the unix-agent poller module. It is better to
ensure that your application is enabled for monitoring. You can check
by following the steps under the `SNMP Extend` heading.
2016-07-26 21:27:12 -05:00
2021-07-10 03:34:01 +08:00
## Apache
2019-07-06 10:51:27 -05:00
2016-09-29 15:07:22 +02:00
Either use SNMP extend or use the agent.
2017-06-09 12:38:20 +02:00
2019-07-06 10:51:27 -05:00
Note that you need to install and configure the Apache
[mod_status ](https://httpd.apache.org/docs/2.4/en/mod/mod_status.html )
module before trying the script.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host (the host must be added
2019-07-06 10:51:27 -05:00
to LibreNMS devices)
2016-08-23 13:46:56 -05:00
```
2016-08-26 20:07:16 +02:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/apache-stats.py -O /etc/snmp/apache-stats.py
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/apache-stats.py
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Create the cache directory, '/var/cache/librenms/' and make sure
2019-08-08 21:18:15 -05:00
that it is owned by the user running the SNMP daemon.
```
mkdir -p /var/cache/librenms/
```
2021-07-18 07:31:09 +01:00
4. Verify it is working by running /etc/snmp/apache-stats.py Package `urllib3` for python3 needs to be
2020-08-18 20:37:04 +02:00
installed. In Debian-based systems for example you can achieve this by issuing:
2018-05-09 02:15:58 +02:00
```
2020-08-18 20:37:04 +02:00
apt-get install python3-urllib3
2019-07-06 10:51:27 -05:00
```
2021-07-18 07:31:09 +01:00
5. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-08-23 13:46:56 -05:00
```
extend apache /etc/snmp/apache-stats.py
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
6. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
7. Test by running
2018-03-13 21:12:02 +01:00
```
snmpwalk <various options depending on your setup> localhost NET-SNMP-EXTEND-MIB::nsExtendOutput2Table
```
2021-07-10 03:34:01 +08:00
### Agent
2016-09-29 15:07:22 +02:00
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `apache` script to `/usr/lib/check_mk_agent/local/`
2021-07-18 07:31:09 +01:00
1. Verify it is working by running /usr/lib/check_mk_agent/local/apache
2019-07-06 10:51:27 -05:00
(If you get error like "Can't locate LWP/Simple.pm". libwww-perl needs
to be installed: apt-get install libwww-perl)
2021-07-18 07:31:09 +01:00
2. Create the cache directory, '/var/cache/librenms/' and make sure
2019-08-08 21:18:15 -05:00
that it is owned by the user running the SNMP daemon.
```
mkdir -p /var/cache/librenms/
```
2021-07-18 07:31:09 +01:00
3. On the device page in Librenms, edit your host and check the
2019-07-06 10:51:27 -05:00
`Apache` under the Applications tab.
2021-07-10 03:34:01 +08:00
## Asterisk
2016-07-26 21:27:12 -05:00
2018-07-21 21:48:32 +02:00
A small shell script that reports various Asterisk call status.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the [asterisk
2019-07-06 10:51:27 -05:00
script](https://github.com/librenms/librenms-agent/blob/master/snmp/asterisk)
to `/etc/snmp/` on your asterisk server.
2019-09-27 18:53:37 -07:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/asterisk -O /etc/snmp/asterisk
```
2018-07-21 21:48:32 +02:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/asterisk
```
2018-07-21 21:48:32 +02:00
2021-07-18 07:31:09 +01:00
3. Configure `ASCLI` in the script.
2018-07-21 21:48:32 +02:00
2021-07-18 07:31:09 +01:00
4. Verify it is working by running `/etc/snmp/asterisk`
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
5. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2018-07-21 21:48:32 +02:00
```
extend asterisk /etc/snmp/asterisk
```
2021-07-18 07:31:09 +01:00
6. Restart snmpd on your host
2018-07-21 21:48:32 +02:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-07-21 21:48:32 +02:00
2021-07-10 03:34:01 +08:00
## backupninja
2020-06-16 01:04:30 +02:00
A small shell script that reports status of last backupninja backup.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-06-16 01:04:30 +02:00
2021-07-18 07:31:09 +01:00
1. Download the [backupninja
2020-06-16 01:04:30 +02:00
script](https://github.com/librenms/librenms-agent/blob/master/snmp/backupninja.py)
to `/etc/snmp/backupninja.py` on your backuped server.
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/backupninja.py -O /etc/snmp/backupninja.py`
```
2021-07-18 07:31:09 +01:00
2. Make the script executable:
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/backupninja.py
```
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2020-06-16 01:04:30 +02:00
```
extend backupninja /etc/snmp/backupninja.py
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2020-06-16 01:04:30 +02:00
2021-07-10 03:34:01 +08:00
## BIND9 aka named
2016-07-26 21:27:12 -05:00
2021-07-18 07:31:09 +01:00
1. Create stats file with appropriate permissions:
2019-10-21 02:47:40 +02:00
```bash
2020-04-19 12:32:23 +02:00
~$ touch /var/cache/bind/stats
~$ chown bind:bind /var/cache/bind/stats
2016-07-26 21:27:12 -05:00
```
Change `user:group` to the user and group that's running bind/named.
2021-07-18 07:31:09 +01:00
2. Bind/named configuration:
2016-07-26 21:27:12 -05:00
```text
options {
2019-07-06 10:51:27 -05:00
...
2020-04-19 12:32:23 +02:00
statistics-file "/var/cache/bind/stats";
2019-07-06 10:51:27 -05:00
zone-statistics yes;
...
2016-07-26 21:27:12 -05:00
};
```
2021-07-18 07:31:09 +01:00
3. Restart your bind9/named after changing the configuration.
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
4. Verify that everything works by executing `rndc stats && cat
2020-05-24 19:51:52 +01:00
/var/cache/bind/stats`. In case you get a ` Permission Denied` error,
2019-07-06 10:51:27 -05:00
make sure you changed the ownership correctly.
2021-07-18 07:31:09 +01:00
5. Also be aware that this file is appended to each time `rndc stats`
2019-07-06 10:51:27 -05:00
is called. Given this it is suggested you setup file rotation for
it. Alternatively you can also set zero_stats to 1 in the config.
2017-05-03 09:23:33 -05:00
2021-08-29 16:19:22 +01:00
6. The script for this also requires the Perl module `File::ReadBackwards` .
2018-05-09 02:15:58 +02:00
```
FreeBSD => p5-File-ReadBackwards
CentOS/RedHat => perl-File-ReadBackwards
Debian/Ubuntu => libfile-readbackwards-perl
```
2019-07-06 10:51:27 -05:00
2018-05-09 02:15:58 +02:00
If it is not available, it can be installed by `cpan -i File::ReadBackwards` .
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
7. You may possibly need to configure the agent/extend script as well.
2017-05-03 09:23:33 -05:00
2019-07-06 10:51:27 -05:00
The config file's path defaults to the same path as the script, but
with .config appended. So if the script is located at
`/etc/snmp/bind` , the config file will be
`/etc/snmp/bind.config` . Alternatively you can also specify a config
via `-c $file` .
Anything starting with a # is comment. The format for variables are
$variable=$value. Empty lines are ignored. Spaces and tabs at either
the start or end of a line are ignored.
2017-05-03 09:23:33 -05:00
2019-07-06 10:51:27 -05:00
Content of an example /etc/snmp/bind.config . Please edit with your
own settings.
2017-05-03 09:23:33 -05:00
```
rndc = The path to rndc. Default: /usr/bin/env rndc
2019-07-06 10:51:27 -05:00
call_rndc = A 0/1 boolean on whether or not to call rndc stats.
Suggest to set to 0 if using netdata. Default: 1
2020-04-19 12:32:23 +02:00
stats_file = The path to the named stats file. Default: /var/cache/bind/stats
2019-07-06 10:51:27 -05:00
agent = A 0/1 boolean for if this is being used as a LibreNMS
agent or not. Default: 0
zero_stats = A 0/1 boolean for if the stats file should be zeroed
first. Default: 0 (1 if guessed)
2017-05-03 09:23:33 -05:00
```
2019-07-06 10:51:27 -05:00
If you want to guess at the configuration, call the script with `-g`
and it will print out what it thinks it should be.
2017-05-03 09:23:33 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the bind shell script, to the desired host.
2017-05-30 14:43:12 +02:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/bind -O /etc/snmp/bind
```
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2018-05-09 02:15:58 +02:00
```
chmod +x /etc/snmp/bind
```
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-05-03 09:23:33 -05:00
```
extend bind /etc/snmp/bind
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on the host in question.
2017-05-03 09:23:33 -05:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
### Agent
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
1. [Install the agent ](Agent-Setup.md ) on this device if it isn't
2019-07-06 10:51:27 -05:00
already and copy the script to `/usr/lib/check_mk_agent/local/bind`
via `wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/bind -O /usr/lib/check_mk_agent/local/bind`
2017-05-03 09:23:33 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /usr/lib/check_mk_agent/local/bind
```
2016-07-26 21:27:12 -05:00
2021-07-18 07:31:09 +01:00
3. Set the variable 'agent' to '1' in the config.
2016-07-26 21:27:12 -05:00
2021-07-10 03:34:01 +08:00
## Certificate
2019-11-05 22:56:31 +01:00
A small python3 script that checks age and remaining validity of certificates
This script needs following packages on Debian/Ubuntu Systems:
2021-06-17 03:16:21 +08:00
2019-11-05 22:56:31 +01:00
* python3
* python3-openssl
Content of an example /etc/snmp/certificate.json . Please edit with your own settings.
```
{"domains": [
{"fqdn": "www.mydomain.com"},
{"fqdn": "some.otherdomain.org",
"port": 8443},
{"fqdn": "personal.domain.net"}
]
}
```
Key 'domains' contains a list of domains to check.
Optional you can define a port. By default it checks on port 443.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-11-05 22:56:31 +01:00
1. Copy the shell script to the desired host.
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/certificate.py -O /etc/snmp/certificate.py
```
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/certificate.py
```
2019-11-05 22:56:31 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
```
extend certificate /etc/snmp/certificate.py
```
4. Restart snmpd on your host
The application should be auto-discovered as described at the top of the page. If it is not, please follow the steps set out under `SNMP Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## C.H.I.P
2017-07-12 22:54:59 +03:00
2019-07-06 10:51:27 -05:00
C.H.I.P. is a $9 R8 based tiny computer ideal for small projects.
Further details: <https://getchip.com/pages/chip>
2021-07-18 07:31:09 +01:00
1. Copy the shell script to the desired host.
2017-07-12 22:54:59 +03:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/chip.sh -O /etc/snmp/power-stat.sh
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/power-stat.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-07-12 22:54:59 +03:00
```
extend power-stat /etc/snmp/power-stat.sh
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## Docker Stats
2021-03-07 20:26:44 +01:00
It allows you to know which container docker run and their stats.
This script require: jq
2021-07-10 03:34:01 +08:00
### SNMP Extend
2021-03-07 20:26:44 +01:00
2021-07-18 07:31:09 +01:00
1. Install jq
2021-03-07 20:26:44 +01:00
```
sudo apt install jq
```
2021-07-18 07:31:09 +01:00
2. Copy the shell script to the desired host.
2021-03-07 20:26:44 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/docker-stats.sh -O /etc/snmp/docker-stats.sh
```
2021-07-18 07:31:09 +01:00
3. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/docker-stats.sh
```
2021-03-07 20:26:44 +01:00
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2021-03-07 20:26:44 +01:00
```
2021-06-17 03:16:21 +08:00
extend docker /etc/snmp/docker-stats.sh
2021-03-07 20:26:44 +01:00
```
2021-12-01 13:46:24 +00:00
5. If your run Debian, you need to add the Debian-snmp user to the docker group
```
usermod -a -G docker Debian-snmp
```
6. Restart snmpd on your host
2021-03-07 20:26:44 +01:00
```
systemctl restart snmpd
```
2021-07-10 03:34:01 +08:00
## Entropy
2016-08-23 13:46:56 -05:00
2018-04-13 17:42:14 +01:00
A small shell script that checks your system's available random entropy.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2018-04-13 17:42:14 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/entropy.sh -O /etc/snmp/entropy.sh
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/entropy.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2018-04-13 17:42:14 +01:00
```
extend entropy /etc/snmp/entropy.sh
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2018-04-13 17:42:14 +01:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
## EXIM Stats
2018-04-13 17:42:14 +01:00
2017-03-09 15:41:52 -06:00
SNMP extend script to get your exim stats data into your host.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2018-09-20 21:43:36 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/exim-stats.sh -O /etc/snmp/exim-stats.sh
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/exim-stats.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2017-03-09 15:41:52 -06:00
```
extend exim-stats /etc/snmp/exim-stats.sh
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. If you are using sudo edit your sudo users (usually `visudo` ) and
2019-07-06 10:51:27 -05:00
add at the bottom:
2017-03-09 15:41:52 -06:00
```
snmp ALL=(ALL) NOPASSWD: /etc/snmp/exim-stats.sh, /usr/bin/exim*
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
5. Restart snmpd on your host
2016-08-23 13:46:56 -05:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
## Fail2ban
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, fail2ban, to the desired host.
2018-05-09 02:15:58 +02:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/fail2ban -O /etc/snmp/fail2ban
```
2016-10-08 15:25:50 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/fail2ban
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-03-09 15:41:52 -06:00
```
extend fail2ban /etc/snmp/fail2ban
```
2022-02-08 11:51:30 +01:00
2021-08-29 16:19:22 +01:00
1. If you want to use the cache, it is as below, by using the -c switch.
```
extend fail2ban /etc/snmp/fail2ban -c
```
2022-02-08 11:51:30 +01:00
2021-08-29 16:19:22 +01:00
2. If you want to use the cache and update it if needed, this can by using the -c and -U switches.
```
extend fail2ban /etc/snmp/fail2ban -c -U
```
2022-02-08 11:51:30 +01:00
2021-08-29 16:19:22 +01:00
3. If you need to specify a custom location for the fail2ban-client, that can be done via the -f switch.
```
extend fail2ban /etc/snmp/fail2ban -f /foo/bin/fail2ban-client
```
If not specified, "/usr/bin/env fail2ban-client" is used.
1. Restart snmpd on your host
2. If you wish to use caching, add the following to /etc/crontab and
2019-07-06 10:51:27 -05:00
restart cron.
2017-03-09 15:41:52 -06:00
```
2019-07-06 10:51:27 -05:00
*/3 * * * * root /etc/snmp/fail2ban -u
2017-03-09 15:41:52 -06:00
```
2021-07-18 07:31:09 +01:00
6. Restart or reload cron on your system.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
If you have more than a few jails configured, you may need to use
caching as each jail needs to be polled and fail2ban-client can't do
so in a timely manner for than a few. This can result in failure of
other SNMP information being polled.
For additional details of the switches, please see the POD in the
script it self at the top.
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
## FreeBSD NFS Client
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, fbsdnfsserver, to the desired host
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/fbsdnfsclient -O /etc/snmp/fbsdnfsclient
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/fbsdnfsclient
```
2016-10-08 15:25:50 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-09 15:41:52 -06:00
```
extend fbsdnfsclient /etc/snmp/fbsdnfsclient
```
2016-10-08 15:25:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## FreeBSD NFS Server
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, fbsdnfsserver, to the desired host
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/fbsdnfsserver -O /etc/snmp/fbsdnfsserver
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/fbsdnfsserver
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-09 15:41:52 -06:00
```
extend fbsdnfsserver /etc/snmp/fbsdnfsserver
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-10-08 15:25:50 -05:00
2021-07-10 03:34:01 +08:00
## FreeRADIUS
2017-12-13 16:13:24 +13:00
2019-07-06 10:51:27 -05:00
The FreeRADIUS application extension requires that status_server be
enabled in your FreeRADIUS config. For more information see:
<https://wiki.freeradius.org/config/Status>
2017-12-13 16:13:24 +13:00
2019-07-06 10:51:27 -05:00
You should note that status requests increment the FreeRADIUS request
stats. So LibreNMS polls will ultimately be reflected in your
stats/charts.
2021-07-18 07:31:09 +01:00
1. Go to your FreeRADIUS configuration directory (usually /etc/raddb
2019-07-06 10:51:27 -05:00
or /etc/freeradius).
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
2. `cd sites-enabled`
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
3. `ln -s ../sites-available/status status`
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
4. Restart FreeRADIUS.
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
5. You should be able to test with the radclient as follows...
2016-08-23 13:46:56 -05:00
```
2017-12-13 16:13:24 +13:00
echo "Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 31, Response-Packet-Type = Access-Accept" | \
radclient -x localhost:18121 status adminsecret
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2019-07-06 10:51:27 -05:00
Note that adminsecret is the default secret key in status_server.
Change if you've modified this.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the freeradius shell script, to the desired host.
2016-08-23 13:46:56 -05:00
```
2017-12-13 16:13:24 +13:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/freeradius.sh -O /etc/snmp/freeradius.sh
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/freeradius.sh
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
3. If you've made any changes to the FreeRADIUS status_server config
2019-07-06 10:51:27 -05:00
(secret key, port, etc.) edit freeradius.sh and adjust the config
variable accordingly.
2016-08-23 13:46:56 -05:00
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file and add:
2017-12-13 16:13:24 +13:00
```
extend freeradius /etc/snmp/freeradius.sh
```
2021-07-18 07:31:09 +01:00
5. Restart snmpd on the host in question.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
### Agent
2016-08-23 13:46:56 -05:00
2021-07-18 07:31:09 +01:00
1. Install the script to your agent
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/freeradius.sh -O /usr/lib/check_mk_agent/local/freeradius.sh`
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /usr/lib/check_mk_agent/local/freeradius.sh
```
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
3. If you've made any changes to the FreeRADIUS status_server config
2019-07-06 10:51:27 -05:00
(secret key, port, etc.) edit freeradius.sh and adjust the config
variable accordingly.
2017-12-13 16:13:24 +13:00
2021-07-18 07:31:09 +01:00
4. Edit the freeradius.sh script and set the variable 'AGENT' to '1'
2019-07-06 10:51:27 -05:00
in the config.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## Freeswitch
2017-03-30 16:11:50 -05:00
2017-10-26 23:03:00 +03:00
A small shell script that reports various Freeswitch call status.
2021-07-10 03:34:01 +08:00
### Agent
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
1. [Install the agent ](Agent-Setup.md ) on this device if it isn't already
2021-07-17 22:07:43 +01:00
and copy the `freeswitch` script to `/usr/lib/check_mk_agent/local/`
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/freeswitch -O /usr/lib/check_mk_agent/local/freeswitch`
```
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /usr/lib/check_mk_agent/local/freeswitch
```
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
3. Configure `FSCLI` in the script. You may also have to create an
2019-07-06 10:51:27 -05:00
`/etc/fs_cli.conf` file if your `fs_cli` command requires
authentication.
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
4. Verify it is working by running `/usr/lib/check_mk_agent/local/freeswitch`
2017-10-26 23:03:00 +03:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/agent-local/freeswitch -O /etc/snmp/freeswitch
```
2017-10-26 23:03:00 +03:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/freeswitch
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Configure `FSCLI` in the script. You may also have to create an
2019-07-06 10:51:27 -05:00
`/etc/fs_cli.conf` file if your `fs_cli` command requires
authentication.
2021-07-18 07:31:09 +01:00
4. Verify it is working by running `/etc/snmp/freeswitch`
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
5. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2017-10-26 23:03:00 +03:00
```
extend freeswitch /etc/snmp/freeswitch
```
2021-07-18 07:31:09 +01:00
6. Restart snmpd on your host
2017-10-26 23:03:00 +03:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-10-26 23:03:00 +03:00
2021-07-10 03:34:01 +08:00
## GPSD
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2019-01-10 00:36:37 -05:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/gpsd -O /etc/snmp/gpsd
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/gpsd
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2019-01-10 00:36:37 -05:00
```
extend gpsd /etc/snmp/gpsd
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading at the top of the page.
2021-07-10 03:34:01 +08:00
### Agent
2017-12-13 16:13:24 +13:00
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `gpsd` script to `/usr/lib/check_mk_agent/local/`
2017-12-13 16:13:24 +13:00
You may need to configure `$server` or `$port` .
Verify it is working by running `/usr/lib/check_mk_agent/local/gpsd`
2021-07-10 03:34:01 +08:00
## Icecast
2020-09-18 20:19:20 +05:30
Shell script that reports load average/memory/open-files stats of Icecast
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-09-18 20:19:20 +05:30
2021-03-08 06:28:09 +11:00
1. Copy the shell script, icecast-stats.sh, to the desired host (the host must be added to LibreNMS devices)
2020-09-18 20:19:20 +05:30
```
2020-10-03 21:56:41 +05:30
wget https://github.com/librenms/librenms-agent/raw/master/snmp/icecast-stats.sh -O /etc/snmp/icecast-stats.sh
2020-09-18 20:19:20 +05:30
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/icecast-stats.sh
```
2020-09-18 20:19:20 +05:30
3. Verify it is working by running `/etc/snmp/icecast-stats.sh`
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file (usually `/etc/snmp/icecast-stats.sh` ) and add:
2020-09-18 20:19:20 +05:30
```
extend icecast /etc/snmp/icecast-stats.sh
```
2022-02-08 11:51:30 +01:00
## ISC DHCP Stats
A small python3 script that reports current DHCP leases stats and pool usage of ISC DHCP Server.
Also you have to install the dhcpd-pools Package.
Under Ubuntu/Debian just run `apt install dhcpd-pools`
### SNMP Extend
1. Copy the shell script to the desired host.
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/dhcp.py -O /etc/snmp/dhcp.py
```
2. Make the script executable
```
chmod +x /etc/snmp/dhcp.py
```
3. Edit your config file, Content of an example /etc/snmp/dhcp.json
```
{"leasefile": "/var/lib/dhcp/dhcpd.leases" }
```
Key 'leasefile' specifies the path to your lease file.
4. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
```
extend dhcpstats /etc/snmp/dhcp.py
```
5. Restart snmpd on your host
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## mailcow-dockerized postfix
2020-03-13 11:16:03 +02:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-03-13 11:16:03 +02:00
2021-07-18 07:31:09 +01:00
1. Download the script into the desired host.
2020-03-13 11:16:03 +02:00
```
2020-03-13 19:32:43 +01:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mailcow-dockerized-postfix -O /etc/snmp/mailcow-dockerized-postfix
2020-03-13 11:16:03 +02:00
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/mailcow-dockerized-postfix
```
> Maybe you will need to install `pflogsumm` on debian based OS. Please check if you have package installed.
2020-03-13 19:32:43 +01:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2020-03-13 11:16:03 +02:00
```
extend mailcow-postfix /etc/snmp/mailcow-dockerized-postfix
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2020-03-13 11:16:03 +02:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## Mailscanner
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2017-12-13 16:13:24 +13:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mailscanner.php -O /etc/snmp/mailscanner.php
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/mailscanner.php
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-12-13 16:13:24 +13:00
```
extend mailscanner /etc/snmp/mailscanner.php
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-12-13 16:13:24 +13:00
2021-07-10 03:34:01 +08:00
## Mdadm
2019-07-09 23:47:32 +02:00
This shell script checks mdadm health and array data
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-09-09 05:48:35 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2019-07-09 23:47:32 +02:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mdadm -O /etc/snmp/mdadm
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/mdadm
```
2019-09-09 05:48:35 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2019-07-09 23:47:32 +02:00
```
extend mdadm /etc/snmp/mdadm
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-09 23:47:32 +02:00
The application should be auto-discovered as described at the
top of the page. If it is not, please follow the steps set out
under `SNMP Extend` heading top of page.
2021-09-20 01:31:23 +02:00
## MegaRAID
This software from Broadcom/LSI let you monitor MegaRAID controller.
1. Download the [external software ](https://docs.broadcom.com/docs/1211132411799 ) and follow the included install instructions.
2. Add the following line to your snmpd.conf file (usually /etc/snmp/snmpd.conf)
```
pass .1.3.6.1.4.1.3582 /usr/sbin/lsi_mrdsnmpmain
```
3. Restart snmpd on your host
2021-07-10 03:34:01 +08:00
## Memcached
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the [memcached
2019-07-06 10:51:27 -05:00
script](https://github.com/librenms/librenms-agent/blob/master/agent-local/memcached)
to `/etc/snmp/` on your remote server.
2018-08-01 08:08:38 -05:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/memcached -O /etc/snmp/memcached
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable:
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/memcached
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2016-08-23 13:46:56 -05:00
```
2016-09-12 22:17:53 -05:00
extend memcached /etc/snmp/memcached
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## Munin
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### Agent
2019-07-06 10:51:27 -05:00
2021-07-17 22:07:43 +01:00
1. Install the script to your agent:
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/munin -O /usr/lib/check_mk_agent/local/munin
```
2. Make the script executable
```
chmod +x /usr/lib/check_mk_agent/local/munin
```
3. Create the munin scripts dir:
```
mkdir -p /usr/share/munin/munin-scripts
```
4. Install your munin scripts into the above directory.
2017-03-09 15:41:52 -06:00
To create your own custom munin scripts, please see this example:
2016-08-23 13:46:56 -05:00
2021-06-17 03:16:21 +08:00
```bash
2017-03-09 15:41:52 -06:00
#!/bin/bash
if [ "$1" = "config" ]; then
echo 'graph_title Some title'
echo 'graph_args --base 1000 -l 0' #not required
echo 'graph_vlabel Some label'
echo 'graph_scale no' #not required, can be yes/no
echo 'graph_category system' #Choose something meaningful, can be anything
echo 'graph_info This graph shows something awesome.' #Short desc
echo 'foobar.label Label for your unit' # Repeat these two lines as much as you like
echo 'foobar.info Desc for your unit.'
exit 0
fi
echo -n "foobar.value " $(date +%s) #Populate a value, here unix-timestamp
```
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## MySQL
2019-07-06 10:51:27 -05:00
2019-08-08 21:18:15 -05:00
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/
```
2019-07-06 10:51:27 -05:00
The MySQL script requires PHP-CLI and the PHP MySQL extension, so
please verify those are installed.
2017-03-09 15:41:52 -06:00
2017-03-30 16:11:50 -05:00
CentOS (May vary based on PHP version)
2017-03-09 15:41:52 -06:00
```
yum install php-cli php-mysql
```
2017-03-30 16:11:50 -05:00
Debian (May vary based on PHP version)
```
2020-09-11 13:09:29 +02:00
apt-get install php-cli php-mysql
2017-03-30 16:11:50 -05:00
```
2019-07-06 10:51:27 -05:00
Unlike most other scripts, the MySQL script requires a configuration
file `mysql.cnf` in the same directory as the extend or agent script
with following content:
2016-07-26 21:27:12 -05:00
```php
<?php
$mysql_user = 'root';
$mysql_pass = 'toor';
$mysql_host = 'localhost';
$mysql_port = 3306;
```
2020-09-11 13:09:29 +02:00
Note that depending on your MySQL installation (chrooted install for example),
you may have to specify 127.0.0.1 instead of localhost. Localhost make
a MySQL connection via the mysql socket, while 127.0.0.1 make a standard
IP connection to mysql.
2021-05-06 17:22:04 +01:00
Note also if you get a mysql error `Uncaught TypeError: mysqli_num_rows(): Argument #1` ,
this is because you are using a newer mysql version which doesnt support `UNBLOCKING` for slave statuses,
so you need to also include the line `$chk_options['slave'] = false;` into `mysql.cnf` to skip checking slave statuses
2021-07-10 03:34:01 +08:00
### Agent
2020-09-11 13:09:29 +02:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `mysql` script to `/usr/lib/check_mk_agent/local/`
2018-05-14 13:33:29 -04:00
Verify it is working by running `/usr/lib/check_mk_agent/local/mysql`
2021-07-10 03:34:01 +08:00
### SNMP extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the mysql script to the desired host.
2021-05-06 17:22:04 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/mysql -O /etc/snmp/mysql
```
2017-03-07 02:15:40 -06:00
2021-07-18 07:31:09 +01:00
2. Make the file executable
2021-05-06 17:22:04 +01:00
```
chmod +x /etc/snmp/mysql
```
2017-03-07 02:15:40 -06:00
2021-11-10 23:39:37 +01:00
3. Edit /etc/snmp/mysql to set your MySQL connection constants or declare them in /etc/snmp/mysql.cnf (new file)
4. Edit your snmpd.conf file and add:
2017-03-07 02:15:40 -06:00
```
2017-03-08 00:47:35 -06:00
extend mysql /etc/snmp/mysql
2017-03-07 02:15:40 -06:00
```
2021-11-10 23:39:37 +01:00
5. Restart snmpd.
2017-03-07 02:15:40 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
## NGINX
2016-07-26 21:27:12 -05:00
2019-07-06 10:51:27 -05:00
NGINX is a free, open-source, high-performance HTTP server: <https://www.nginx.org/>
It's required to have the following directive in your nginx
configuration responsible for the localhost server:
2016-07-26 21:27:12 -05:00
```text
location /nginx-status {
stub_status on;
2021-06-17 03:16:21 +08:00
access_log off;
2016-07-26 21:27:12 -05:00
allow 127.0.0.1;
2018-11-18 00:41:55 +01:00
allow ::1;
2021-06-17 03:16:21 +08:00
deny all;
2016-07-26 21:27:12 -05:00
}
```
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2017-03-30 16:11:50 -05:00
```
2018-10-17 12:25:38 -04:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/nginx -O /etc/snmp/nginx
2017-03-30 16:11:50 -05:00
```
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/nginx
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-03-30 16:11:50 -05:00
```
2018-10-17 12:25:38 -04:00
extend nginx /etc/snmp/nginx
2017-03-30 16:11:50 -05:00
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
### Agent
2018-05-09 02:15:58 +02:00
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `nginx` script to `/usr/lib/check_mk_agent/local/`
2021-07-10 03:34:01 +08:00
## NFS Server
2017-03-30 16:11:50 -05:00
2017-04-28 23:48:26 +02:00
Export the NFS stats from as server.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add :
2017-04-28 23:48:26 +02:00
```
extend nfs-server /bin/cat /proc/net/rpc/nfsd
```
2021-08-29 16:19:22 +01:00
>find out where cat is located using : `which cat`
2017-04-28 23:48:26 +02:00
2021-07-18 07:31:09 +01:00
2. reload snmpd service to activate the configuration
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
## NTP Client
2017-03-30 16:11:50 -05:00
2016-09-10 15:37:00 +03:00
A shell script that gets stats from ntp client.
2016-08-15 23:54:13 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2016-08-15 23:54:13 -05:00
```
2018-10-17 12:25:38 -04:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/ntp-client -O /etc/snmp/ntp-client
2016-08-15 23:54:13 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/ntp-client
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-08-15 23:54:13 -05:00
```
2018-10-17 12:25:38 -04:00
extend ntp-client /etc/snmp/ntp-client
2016-08-15 23:54:13 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-08-15 23:54:13 -05:00
2021-07-10 03:34:01 +08:00
## NTP Server aka NTPD
2018-05-09 02:15:58 +02:00
2016-09-10 15:37:00 +03:00
A shell script that gets stats from ntp server (ntpd).
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2018-05-09 02:15:58 +02:00
1. Download the script onto the desired host.
2016-09-10 15:37:00 +03:00
```
2016-09-12 22:17:53 -05:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/ntp-server.sh -O /etc/snmp/ntp-server.sh
2016-09-10 15:37:00 +03:00
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/ntp-server.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-09-10 15:37:00 +03:00
```
extend ntp-server /etc/snmp/ntp-server.sh
```
2016-08-15 23:54:13 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2022-06-26 17:19:55 +03:00
## Chronyd
A shell script that gets the stats from chronyd and exports them with SNMP Extend.
### SNMP Extend
1. Download the shell script onto the desired host
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/chrony -O /etc/snmp/chrony
```
2. Make the script executable
```
chmod +x /etc/snmp/chrony
```
3. Edit the snmpd.conf file to include the extend by adding the following line to the end of the config file:
```
extend chronyd /etc/snmp/chrony
```
Note: Some distributions need sudo-permissions for the script to work with SNMP Extend. See the instructions on the section SUDO for more information.
4. Restart snmpd service on the host
2022-06-30 20:42:48 +10:00
Application should be auto-discovered and its stats presented on the Apps-page on the host. Note: Applications module needs to be enabled on the host or globally for the statistics to work as intended.
2022-06-26 17:19:55 +03:00
2021-07-10 03:34:01 +08:00
## Nvidia GPU
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, nvidia, to the desired host
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/nvidia -O /etc/snmp/nvidia
```
2017-03-09 15:41:52 -06:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/nvidia
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-09 15:41:52 -06:00
```
extend nvidia /etc/snmp/nvidia
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host.
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
5. Verify you have nvidia-smi installed, which it generally should be
2019-07-06 10:51:27 -05:00
if you have the driver from Nvida installed.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The GPU numbering on the graphs will correspond to how the nvidia-smi
sees them as being.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
For questions about what the various values are/mean, please see the
nvidia-smi man file under the section covering dmon.
2021-07-10 03:34:01 +08:00
## Open Grid Scheduler
2016-08-23 13:46:56 -05:00
2017-04-24 15:19:36 +02:00
Shell script to track the OGS/GE jobs running on clusters.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2017-04-24 15:19:36 +02:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/rocks.sh -O /etc/snmp/rocks.sh
```
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/rocks.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-04-24 15:19:36 +02:00
```
extend ogs /etc/snmp/rocks.sh
```
2018-05-09 02:15:58 +02:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd.
2017-04-24 15:19:36 +02:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## Opensips
2020-09-18 20:19:20 +05:30
Script that reports load-average/memory/open-files stats of Opensips
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-09-18 20:19:20 +05:30
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/opensips-stats.sh -O /etc/snmp/opensips-stats.sh
```
2020-09-18 20:19:20 +05:30
2021-07-18 07:31:09 +01:00
2. Make the script executable:
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/opensips-stats.sh
```
2020-09-18 20:19:20 +05:30
3. Verify it is working by running `/etc/snmp/opensips-stats.sh`
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2020-09-18 20:19:20 +05:30
```
extend opensips /etc/snmp/opensips-stats.sh
```
2021-07-10 03:34:01 +08:00
## OS Updates
2019-07-06 10:51:27 -05:00
A small shell script that checks your system package manager for any
available updates. Supports apt-get/pacman/yum/zypper package
managers.
For pacman users automatically refreshing the database, it is
recommended you use an alternative database location
`--dbpath=/var/lib/pacman/checkupdate`
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host.
2017-01-10 10:29:23 +01:00
```
2018-10-17 12:25:38 -04:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/osupdate -O /etc/snmp/osupdate
2017-01-10 10:29:23 +01:00
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/osupdate
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-08-23 13:46:56 -05:00
```
2018-10-17 12:25:38 -04:00
extend osupdate /etc/snmp/osupdate
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
_Note_: apt-get depends on an updated package index. There are several
ways to have your system run `apt-get update` automatically. The
easiest is to create `/etc/apt/apt.conf.d/10periodic` and pasting the
following in it: `APT::Periodic::Update-Package-Lists "1";` . If you
have apticron, cron-apt or apt-listchanges installed and configured,
chances are that packages are already updated periodically .
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## PHP-FPM
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, phpfpmsp, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/phpfpmsp -O /etc/snmp/phpfpmsp
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/phpfpmsp
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2017-03-09 15:41:52 -06:00
```
2018-10-17 12:25:38 -04:00
extend phpfpmsp /etc/snmp/phpfpmsp
2017-03-09 15:41:52 -06:00
```
2018-09-14 15:03:25 +02:00
2021-07-18 07:31:09 +01:00
4. Edit /etc/snmp/phpfpmsp to include the status URL for the PHP-FPM
2019-07-06 10:51:27 -05:00
pool you are monitoring.
2021-07-18 07:31:09 +01:00
5. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
It is worth noting that this only monitors a single pool. If you want
to monitor multiple pools, this won't do it.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
## Pi-hole
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-06-06 01:00:09 +03:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, pi-hole, to the desired host.
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/pi-hole -O /etc/snmp/pi-hole
```
2017-06-06 01:00:09 +03:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/pi-hole
```
2017-06-06 01:00:09 +03:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-06-06 01:00:09 +03:00
```
extend pi-hole /etc/snmp/pi-hole
```
2021-07-18 07:31:09 +01:00
4. To get all data you must get your API auth token from Pi-hole
2019-07-06 10:51:27 -05:00
server and change the API_AUTH_KEY entry inside the snmp script.
2017-06-06 01:00:09 +03:00
2021-07-18 07:31:09 +01:00
5. Restard snmpd.
2017-06-06 01:00:09 +03:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## Portactivity
2017-06-06 01:00:09 +03:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2018-11-22 09:05:38 -06:00
2021-07-18 07:31:09 +01:00
1. Install missing packages - Ubuntu is shown below.
2019-07-02 14:37:21 +02:00
```
apt install libparse-netstat-perl
apt install libjson-perl
```
2018-11-22 09:05:38 -06:00
2021-07-18 07:31:09 +01:00
2. Copy the Perl script to the desired host (the host must be added to LibreNMS devices)
2018-11-22 09:05:38 -06:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/portactivity -O /etc/snmp/portactivity
```
2021-07-18 07:31:09 +01:00
3. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/portactivity
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2018-11-22 09:05:38 -06:00
```
extend portactivity /etc/snmp/portactivity -p http,ldap,imap
```
2021-08-29 16:19:22 +01:00
>Will monitor HTTP, LDAP, and IMAP. The -p switch specifies what ports to use. This is a comma seperated list.
>
>These must be found in '/etc/services' or where ever NSS is set to fetch it from. If not, it will throw an error.
>
>If you want to JSON returned by it to be printed in a pretty format use the -P flag.
2018-11-22 09:05:38 -06:00
2021-07-18 07:31:09 +01:00
5. Restart snmpd on your host.
2018-11-22 09:05:38 -06:00
Please note that for only TCP[46] services are supported.
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
## Postfix
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, postfix-queues, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/postfix-queues -O /etc/snmp/postfix-queues
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
2. Copy the Perl script, postfixdetailed, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/postfixdetailed -O /etc/snmp/postfixdetailed
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Make both scripts executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/postfixdetailed /etc/snmp/postfix-queues
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file and add:
2017-03-09 15:41:52 -06:00
```
extend mailq /etc/snmp/postfix-queues
extend postfixdetailed /etc/snmp/postfixdetailed
```
2021-07-18 07:31:09 +01:00
5. Restart snmpd.
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
6. Install pflogsumm for your OS.
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
7. Make sure the cache file in /etc/snmp/postfixdetailed is some place
2019-07-06 10:51:27 -05:00
that snmpd can write too. This file is used for tracking changes
between various values between each time it is called by snmpd. Also
make sure the path for pflogsumm is correct.
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
8. Run /etc/snmp/postfixdetailed to create the initial cache file so
2019-07-06 10:51:27 -05:00
you don't end up with some crazy initial starting value. Please note
that each time /etc/snmp/postfixdetailed is ran, the cache file is
updated, so if this happens in between LibreNMS doing it then the
values will be thrown off for that polling period.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
> NOTE: If using RHEL for your postfix server, qshape must be
> installed manually as it is not officially supported. CentOs 6 rpms
> seem to work without issues.
2018-08-15 15:02:53 -04:00
2021-07-10 03:34:01 +08:00
## Postgres
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, postgres, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/postgres -O /etc/snmp/postgres
```
2017-03-09 15:41:52 -06:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/postgres
```
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-09 15:41:52 -06:00
```
extend postgres /etc/snmp/postgres
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
5. Install the Nagios check check_postgres.pl on your system:
2019-07-06 10:51:27 -05:00
<https://github.com/bucardo/check_postgres>
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
6. Verify the path to check_postgres.pl in /etc/snmp/postgres is
2019-07-06 10:51:27 -05:00
correct.
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
7. If you wish it to ignore the database postgres for totalling up the
2019-07-06 10:51:27 -05:00
stats, set ignorePG to 1(the default) in /etc/snmp/postgres. If you
are using netdata or the like, you may wish to set this or otherwise
that total will be very skewed on systems with light or moderate usage.
2017-03-09 15:41:52 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
## PowerDNS
2019-01-17 11:43:43 -06:00
2019-07-06 10:51:27 -05:00
An authoritative DNS server: <https://www.powerdns.com/auth.html>
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, powerdns.py, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns.py -O /etc/snmp/powerdns.py
```
2019-01-17 11:43:43 -06:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/powerdns.py
```
2019-01-17 11:43:43 -06:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2019-01-17 11:43:43 -06:00
```
extend powerdns /etc/snmp/powerdns.py
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-01-17 11:43:43 -06:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
### Agent
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `powerdns` script to `/usr/lib/check_mk_agent/local/`
2021-07-10 03:34:01 +08:00
## PowerDNS Recursor
2019-07-06 10:51:27 -05:00
A recursive DNS server: <https://www.powerdns.com/recursor.html>
2019-01-17 11:43:43 -06:00
2021-07-10 03:34:01 +08:00
### Direct
2016-07-26 21:27:12 -05:00
2019-07-06 10:51:27 -05:00
The LibreNMS polling host must be able to connect to port 8082 on the
monitored device. The web-server must be enabled, see the Recursor
docs: <https://doc.powerdns.com/md/recursor/settings/#webserver >
2016-08-23 13:46:56 -05:00
2021-07-10 03:34:01 +08:00
### Variables
2017-03-30 16:11:50 -05:00
2019-07-06 10:51:27 -05:00
`$config['apps']['powerdns-recursor']['api-key']` required, this is
defined in the Recursor config
2016-07-26 21:27:12 -05:00
2019-07-06 10:51:27 -05:00
`$config['apps']['powerdns-recursor']['port']` numeric, defines the
port to connect to PowerDNS Recursor on. The default is 8082
2016-08-02 08:27:06 -05:00
2019-07-06 10:51:27 -05:00
`$config['apps']['powerdns-recursor']['https']` true or false,
defaults to use http.
2016-07-26 21:27:12 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, powerdns-recursor, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns-recursor -O /etc/snmp/powerdns-recursor
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/powerdns-recursor
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-30 16:11:50 -05:00
```
extend powerdns-recursor /etc/snmp/powerdns-recursor
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2017-03-30 16:11:50 -05:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
### Agent
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `powerdns-recursor` script to
`/usr/lib/check_mk_agent/local/`
2016-07-26 21:27:12 -05:00
This script uses `rec_control get-all` to collect stats.
2021-07-10 03:34:01 +08:00
## PowerDNS-dnsdist
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the BASH script to the desired host.
2018-01-06 22:05:06 +02:00
```
2019-07-06 10:51:27 -05:00
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns-dnsdist -O /etc/snmp/powerdns-dnsdist
2018-01-06 22:05:06 +02:00
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/powerdns-dnsdist
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2018-01-06 22:05:06 +02:00
```
extend powerdns-dnsdist /etc/snmp/powerdns-dnsdist
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host.
2018-01-06 22:05:06 +02:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
## PowerMon
2021-03-08 06:28:09 +11:00
PowerMon tracks the power usage on your host and can report on both consumption
and cost, using a python script installed on the host.
[PowerMon consumption graph ](../img/example-app-powermon-consumption-02.png )
Currently the script uses one of two methods to determine current power usage:
* ACPI via libsensors
* HP-Health (HP Proliant servers only)
The ACPI method is quite unreliable as it is usually only implemented by
battery-powered devices, e.g. laptops. YMMV. However, it's possible to support
any method as long as it can return a power value, usually in Watts.
> TIP: You can achieve this by adding a method and a function for that method to
> the script. It should be called by getData() and return a dictionary.
Because the methods are unreliable for all hardware, you need to declare to the
script which method to use. The are several options to assist with testing, see
`--help` .
2021-07-10 03:34:01 +08:00
### SNMP Extend
2021-03-08 06:28:09 +11:00
2021-07-10 03:34:01 +08:00
#### Initial setup
2021-03-08 06:28:09 +11:00
2021-06-17 03:16:21 +08:00
1. Download the python script onto the host:
2021-03-08 06:28:09 +11:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/powermon-snmp.py -O /usr/local/bin/powermon-snmp.py
```
2. Make the script executable:
```
chmod +x /usr/local/bin/powermon-snmp.py
```
3. Edit the script and set the cost per kWh for your supply. You must uncomment
this line for the script to work:
```
vi /usr/local/bin/powermon-snmp.py
#costPerkWh = 0.15
```
4. Choose you method below:
2021-07-18 07:31:09 +01:00
=== "Method 1. sensors"
2021-03-08 06:28:09 +11:00
* Install dependencies:
```
dnf install lm_sensors
pip install PySensors
```
* Test the script from the command-line. For example:
```
$ /usr/local/bin/powermon-snmp.py -m sensors -n -p
{
"meter": {
"0": {
"reading": 0.0
}
},
"psu": {},
"supply": {
"rate": 0.15
},
"reading": "0.0"
}
```
If you see a reading of `0.0` it is likely this method is not supported for
your system. If not, continue.
2021-07-18 07:31:09 +01:00
=== "Method 2. hpasmcli"
2021-03-08 06:28:09 +11:00
* Obtain the hp-health package for your system. Generally there are
three options:
* Standalone package from [HPE Support ](https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX-c0104db95f574ae6be873e2064#tab2 )
* From the HP Management Component Pack (MCP).
* Included in the [HP Service Pack for Proliant (SPP) ](https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-a00026884en_us )
* If you've downloaded the standalone package, install it. For example:
```
rpm -ivh hp-health-10.91-1878.11.rhel8.x86_64.rpm
```
* Check the service is running:
```
systemctl status hp-health
```
* Test the script from the command-line. For example:
```
$ /usr/local/bin/powermon-snmp.py -m hpasmcli -n -p
{
"meter": {
"1": {
"reading": 338.0
}
},
"psu": {
"1": {
"present": "Yes",
"redundant": "No",
"condition": "Ok",
"hotplug": "Supported",
"reading": 315.0
},
"2": {
"present": "Yes",
"redundant": "No",
"condition": "FAILED",
"hotplug": "Supported"
}
},
"supply": {
"rate": 0.224931
},
"reading": 338.0
}
```
If you see a reading of `0.0` it is likely this method is not supported for
your system. If not, continue.
2021-07-10 03:34:01 +08:00
#### Finishing Up
2021-03-08 06:28:09 +11:00
5. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add the following:
```
extend powermon /usr/local/bin/powermon-snmp.py -m hpasmcli
```
> NOTE: Avoid using other script options in the snmpd config as the results may not be
> interpreted correctly by LibreNMS.
6. Reload your snmpd service:
```
systemctl reload snmpd
```
7. You're now ready to enable the application in LibreNMS.
2021-07-10 03:34:01 +08:00
## Proxmox
2017-06-14 21:31:04 +02:00
2021-07-18 07:31:09 +01:00
1. For Proxmox 4.4+ install the libpve-apiclient-perl package
2021-07-17 22:07:43 +01:00
```
apt install libpve-apiclient-perl
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox
```
2017-03-30 16:11:50 -05:00
2021-07-17 22:07:43 +01:00
3. Make the script executable
```
chmod +x /usr/local/bin/proxmox
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
4. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2021-07-17 22:07:43 +01:00
```
extend proxmox /usr/local/bin/proxmox
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
5. Note: if your snmpd doesn't run as root, you might have to invoke
2019-07-06 10:51:27 -05:00
the script using sudo and modify the "extend" line
2017-03-30 16:11:50 -05:00
2017-11-15 21:52:48 +01:00
```
2019-07-06 10:51:27 -05:00
extend proxmox /usr/bin/sudo /usr/local/bin/proxmox
2017-11-15 21:52:48 +01:00
```
after, edit your sudo users (usually `visudo` ) and add at the bottom:
2019-07-06 10:51:27 -05:00
2017-11-15 21:52:48 +01:00
```
2020-06-22 12:34:25 +02:00
Debian-snmp ALL=(ALL) NOPASSWD: /usr/local/bin/proxmox
2017-11-15 21:52:48 +01:00
```
2021-07-18 07:31:09 +01:00
6. Restart snmpd on your host
2017-03-30 16:11:50 -05:00
2021-07-10 03:34:01 +08:00
## Puppet Agent
2020-02-12 08:26:02 +01:00
SNMP extend script to get your Puppet Agent data into your host.
2021-10-02 14:16:55 +01:00
### SNMP Extend
2020-02-12 08:26:02 +01:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/puppet_agent.py -O /etc/snmp/puppet_agent.py
```
2020-02-12 08:26:02 +01:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/puppet_agent.py
```
2020-02-12 08:26:02 +01:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2020-02-12 08:26:02 +01:00
```
extend puppet-agent /etc/snmp/puppet_agent.py
```
The Script needs `python3-yaml` package to be installed.
Per default script searches for on of this files:
* /var/cache/puppet/state/last_run_summary.yaml
* /opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
optionally you can add a specific summary file with creating `/etc/snmp/puppet.json`
```
{
"agent": {
"summary_file": "/my/custom/path/to/summary_file"
}
}
```
custom summary file has highest priority
2021-07-18 07:31:09 +01:00
4. Restart snmpd on the host
2020-02-12 08:26:02 +01:00
2021-07-10 03:34:01 +08:00
## PureFTPd
2020-01-22 01:50:11 +01:00
SNMP extend script to monitor PureFTPd.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-01-22 01:50:11 +01:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/pureftpd.py -O /etc/snmp/pureftpd.py
```
2020-01-22 01:50:11 +01:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/pureftpd.py
```
2020-01-22 01:50:11 +01:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2020-01-22 01:50:11 +01:00
```
2020-05-30 19:19:13 +02:00
extend pureftpd sudo /etc/snmp/pureftpd.py
2020-01-22 01:50:11 +01:00
```
2021-07-18 07:31:09 +01:00
4. Edit your sudo users (usually `visudo` ) and add at the bottom:
2020-01-22 01:50:11 +01:00
```
2020-05-30 19:19:13 +02:00
snmp ALL=(ALL) NOPASSWD: /etc/snmp/pureftpd.py
2020-01-22 01:50:11 +01:00
```
or the path where your pure-ftpwho is located
2021-07-18 07:31:09 +01:00
5. If pure-ftpwho is not located in /usr/sbin
2020-01-22 01:50:11 +01:00
2020-02-12 08:26:02 +01:00
you will also need to create a config file, which is named
2020-01-22 01:50:11 +01:00
2020-02-12 08:26:02 +01:00
pureftpd.json. The file has to be located in /etc/snmp/.
2020-01-22 01:50:11 +01:00
```
{"pureftpwho_cmd": "/usr/sbin/pure-ftpwho"
}
```
2021-07-18 07:31:09 +01:00
5. Restart snmpd on your host
2020-01-22 01:50:11 +01:00
2021-07-10 03:34:01 +08:00
## Raspberry PI
2016-08-23 13:46:56 -05:00
SNMP extend script to get your PI data into your host.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/raspberry.sh -O /etc/snmp/raspberry.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/raspberry.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2016-08-23 13:46:56 -05:00
```
2020-12-10 01:02:30 +01:00
extend raspberry /usr/bin/sudo /bin/sh /etc/snmp/raspberry.sh
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Edit your sudo users (usually `visudo` ) and add at the bottom:
2016-08-23 13:46:56 -05:00
```
2020-12-10 01:02:30 +01:00
snmp ALL=(ALL) NOPASSWD: /bin/sh /etc/snmp/raspberry.sh
2016-08-23 13:46:56 -05:00
```
2017-03-30 16:11:50 -05:00
2019-07-06 10:51:27 -05:00
**Note:** If you are using Raspian, the default user is
`Debian-snmp` . Change `snmp` above to `Debian-snmp` . You can verify
the user snmpd is using with `ps aux | grep snmpd`
2018-06-14 08:23:27 +12:00
2021-07-18 07:31:09 +01:00
5. Restart snmpd on PI host
2016-08-23 13:46:56 -05:00
2021-11-05 03:38:15 +01:00
## Raspberry Pi GPIO Monitor
SNMP extend script to monitor your IO pins or sensor modules connected to your GPIO header.
### SNMP Extend
1: Make sure you have wiringpi installed on your Raspberry Pi. In Debian-based systems for example you can achieve this by issuing:
```
apt-get install wiringpi
```
2: Download the script to your Raspberry Pi. `wget
https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/rpigpiomonitor.php
-O /etc/snmp/rpigpiomonitor.php`
3: (optional) Download the example configuration to your Raspberry Pi. `wget
https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/rpigpiomonitor.ini
-O /etc/snmp/rpigpiomonitor.ini`
4: Make the script executable: `chmod +x /etc/snmp/rpigpiomonitor.php`
5: Create or edit your rpigpiomonitor.ini file according to your needs.
6: Check your configuration with `rpigpiomonitor.php -validate`
7: Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
```
extend rpigpiomonitor /etc/snmp/rpigpiomonitor.php
```
8: Restart snmpd on your Raspberry Pi and, if your Raspberry Pi is already present in LibreNMS, perform a manual rediscover.
2021-07-10 03:34:01 +08:00
## Redis
2020-05-15 22:05:40 +02:00
SNMP extend script to monitor your Redis Server
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-05-15 22:05:40 +02:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/redis.py -O /etc/snmp/redis.py
```
2020-05-15 22:05:40 +02:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/redis.py
```
2020-05-15 22:05:40 +02:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2020-05-15 22:05:40 +02:00
```
extend redis /etc/snmp/redis.py
```
2021-07-10 03:34:01 +08:00
## RRDCached
2021-02-14 16:00:56 +00:00
Install/Setup:
For Install/Setup Local Librenms RRDCached: Please see [RRDCached ](RRDCached.md )
Will collect stats by:
2021-07-18 07:31:09 +01:00
1. Connecting directly to the associated device on port 42217
2. Monitor thru snmp with SNMP extend, as outlined below
3. Connecting to the rrdcached server specified by the `rrdcached` setting
2021-02-14 16:00:56 +00:00
SNMP extend script to monitor your (remote) RRDCached via snmp
2021-07-10 03:34:01 +08:00
### SNMP Extend
2021-02-14 16:00:56 +00:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
2022-01-20 10:41:29 -06:00
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/rrdcached -O /etc/snmp/rrdcached
2021-07-17 22:07:43 +01:00
```
2021-02-14 16:00:56 +00:00
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/rrdcached
```
2021-02-14 16:00:56 +00:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf` ) and add:
2021-02-14 16:00:56 +00:00
```
extend rrdcached /etc/snmp/rrdcached
```
2021-07-10 03:34:01 +08:00
## SDFS info
2021-06-17 03:16:21 +08:00
A small shell script that exportfs SDFS volume info.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2021-06-17 03:16:21 +08:00
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-06-17 03:16:21 +08:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/sdfsinfo -O /etc/snmp/sdfsinfo
```
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/sdfsinfo
```
2021-06-17 03:16:21 +08:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2021-06-17 03:16:21 +08:00
```
extend sdfsinfo /etc/snmp/sdfsinfo
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2021-06-17 03:16:21 +08:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-10 03:34:01 +08:00
## Seafile
2019-10-22 00:28:21 +02:00
2019-12-04 09:41:30 +01:00
SNMP extend script to monitor your Seafile Server
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-10-22 00:28:21 +02:00
2021-07-18 07:31:09 +01:00
1. Copy the Python script, seafile.py, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/seafile.py -O /etc/snmp/seafile.py
```
2019-10-22 00:28:21 +02:00
Also you have to install the requests Package for Python3.
Under Ubuntu/Debian just run `apt install python3-requests`
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/seafile.py
```
2019-10-22 00:28:21 +02:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2019-10-22 00:28:21 +02:00
```
extend seafile /etc/snmp/seafile.py
```
2021-07-18 07:31:09 +01:00
4. You will also need to create the config file, which is named
2019-10-22 00:28:21 +02:00
seafile.json . The script has to be located at /etc/snmp/.
```
{"url": "https://seafile.mydomain.org",
"username": "some_admin_login@mail .address",
"password": "password",
"account_identifier": "name"
"hide_monitoring_account": true
}
```
The variables are as below.
```
url = Url how to get access to Seafile Server
username = Login to Seafile Server.
It is important that used Login has admin privileges.
Otherwise most API calls will be denied.
password = Password to the configured login.
2019-12-04 09:41:30 +01:00
account_identifier = Defines how user accounts are listed in RRD Graph.
2019-10-22 00:28:21 +02:00
Options are: name, email
hide_monitoring_account = With this Boolean you can hide the Account which you
use to access Seafile API
```
2019-12-04 09:41:30 +01:00
**Note:**It is recommended to use a dedicated Administrator account for monitoring.
2021-07-10 03:34:01 +08:00
## SMART
2017-03-22 09:28:50 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2019-07-06 10:51:27 -05:00
2020-03-23 20:19:10 +01:00
1. Copy the Perl script, smart, to the desired host.
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/smart -O /etc/snmp/smart
```
2017-03-22 09:28:50 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/smart
```
2020-03-23 20:19:10 +01:00
3. Edit your snmpd.conf file and add:
2017-03-22 09:28:50 -05:00
```
extend smart /etc/snmp/smart
```
2020-03-23 20:19:10 +01:00
4. You will also need to create the config file, which defaults to the same path as the script,
but with .config appended. So if the script is located at /etc/snmp/smart, the config file
will be `/etc/snmp/smart.config` . Alternatively you can also specific a config via `-c` .
2019-07-06 10:51:27 -05:00
2020-03-23 20:19:10 +01:00
Anything starting with a # is comment. The format for variables is $variable=$value. Empty
lines are ignored. Spaces and tabes at either the start or end of a line are ignored. Any
line with out a matched variable or # are treated as a disk.
2017-03-22 09:28:50 -05:00
```
#This is a comment
cache=/var/cache/smart
smartctl=/usr/bin/env smartctl
2018-04-27 16:49:30 -05:00
useSN=1
2017-03-22 09:28:50 -05:00
ada0
ada1
2020-03-23 20:19:10 +01:00
da5 /dev/da5 -d sat
twl0,0 /dev/twl0 -d 3ware,0
twl0,1 /dev/twl0 -d 3ware,1
twl0,2 /dev/twl0 -d 3ware,2
2017-03-22 09:28:50 -05:00
```
The variables are as below.
2019-07-06 10:51:27 -05:00
2017-03-22 09:28:50 -05:00
```
cache = The path to the cache file to use. Default: /var/cache/smart
smartctl = The path to use for smartctl. Default: /usr/bin/env smartctl
2020-03-23 20:19:10 +01:00
useSN = If set to 1, it will use the disks SN for reporting instead of the device name.
1 is the default. 0 will use the device name.
2017-03-22 09:28:50 -05:00
```
2020-03-23 20:19:10 +01:00
A disk line is can be as simple as just a disk name under /dev/. Such as in the config above
The line "ada0" would resolve to "/dev/ada0" and would be called with no special argument. If
a line has a space in it, everything before the space is treated as the disk name and is what
used for reporting and everything after that is used as the argument to be passed to smartctl.
2017-03-22 09:28:50 -05:00
2020-03-23 20:19:10 +01:00
If you want to guess at the configuration, call it with -g and it will print out what it thinks
it should be.
5. Restart snmpd on your host
2017-03-22 09:28:50 -05:00
2019-07-06 10:51:27 -05:00
If you have a large number of more than one or two disks on a system,
you should consider adding this to cron. Also make sure the cache file
is some place it can be written to.
2017-03-22 09:28:50 -05:00
```
* /3 * * * * /etc/snmp/smart -u
```
2020-03-23 20:19:10 +01:00
6. If your snmp agent runs as user "snmp", edit your sudo users
2019-07-06 10:51:27 -05:00
(usually `visudo` ) and add at the bottom:
2017-11-15 21:51:41 +01:00
```
2020-03-23 20:19:10 +01:00
snmp ALL=(ALL) NOPASSWD: /etc/snmp/smart, /usr/bin/env smartctl
2017-11-15 21:51:41 +01:00
```
2019-07-06 10:51:27 -05:00
2017-11-15 21:51:41 +01:00
and modify your snmpd.conf file accordingly:
2019-07-06 10:51:27 -05:00
2017-11-15 21:51:41 +01:00
```
extend smart /usr/bin/sudo /etc/snmp/smart
2019-07-06 10:51:27 -05:00
```
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-11-15 21:51:41 +01:00
2019-07-06 10:51:27 -05:00
If you set useSN to 1, it is worth noting that you will loose
history(not able to access it from the web interface) for that device
each time you change it. You will also need to run camcontrol or the
like on said server to figure out what device actually corresponds
with that serial number.
2018-04-27 16:49:30 -05:00
2019-07-06 10:51:27 -05:00
Also if the system you are using uses non-static device naming based
on bus information, it may be worthwhile just using the SN as the
device ID is going to be irrelevant in that case.
2018-04-27 16:49:30 -05:00
2021-07-10 03:34:01 +08:00
## Squid
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### SNMP Proxy
2017-03-09 15:41:52 -06:00
2021-07-18 07:31:09 +01:00
1. Enable SNMP for Squid like below, if you have not already, and restart it.
2017-03-09 15:41:52 -06:00
```
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic localhost
snmp_access deny all
```
2021-07-18 07:31:09 +01:00
2. Restart squid on your host.
2016-08-23 13:46:56 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add, making sure you have the same
2019-07-06 10:51:27 -05:00
community, host, and port as above:
2017-03-09 15:41:52 -06:00
```
2021-07-18 07:31:09 +01:00
proxy -v 2c -Cc -c public 127.0.0.1.3401 1.3.6.1.4.1.3495
2017-03-09 15:41:52 -06:00
```
2019-07-06 10:51:27 -05:00
For more advanced information on Squid and SNMP or setting up proxying
for net-snmp, please see the links below.
<http://wiki.squid-cache.org/Features/Snmp>
<http://www.net-snmp.org/wiki/index.php/Snmpd_proxy>
2022-01-13 18:19:27 +01:00
## Supervisord
It shows you the totals per status and also the uptime per process. That way you can add alerts for instance when there are process in state `FATAL` .
### SNMP Extend
1. Copy the python script to the desired host.
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/supervisord.py -O /etc/snmp/supervisord.py
```
Notice that this will use the default unix socket path. Modify the `unix_socket_path` variable in the script if your path differs from the default.
2. Make the script executable
```
chmod +x /etc/snmp/supervisord.py
```
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
```
extend supervisord /etc/snmp/supervisord.py
```
4. Restart snmpd on your host
```
systemctl restart snmpd
```
2022-04-25 20:30:49 -05:00
## Suricata
### SNMP Extend
1. Install the extend.
```
cpanm Suricata::Monitoring
```
2. Setup cron. Below is a example.
```
*/5 * * * * /usr/local/bin/suricata_stat_check > /dev/null
```
3. Configure snmpd.conf
```
extend suricata-stats /usr/bin/env PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin suricata_stat_check -c
```
4. Restart snmpd on your system.
You will want to make sure Suricata is set to output the stats
to the eve file once a minute. This will help make sure that
it won't be to far back in the file and will make sure it is
recent when the cronjob runs.
Any configuration of suricata_stat_check should be done in the cron
setup. If the default does not work, check the docs for it at
[MetaCPAN for
suricata_stat_check](https://metacpan. org/dist/Suricata-Monitoring/view/bin/suricata_stat_check)
2021-07-10 03:34:01 +08:00
## TinyDNS aka djbdns
2017-03-09 15:41:52 -06:00
2021-07-10 03:34:01 +08:00
### Agent
2016-08-23 13:46:56 -05:00
2019-07-06 10:51:27 -05:00
[Install the agent ](Agent-Setup.md ) on this device if it isn't already
and copy the `tinydns` script to `/usr/lib/check_mk_agent/local/`
2016-07-26 21:27:12 -05:00
2019-07-06 10:51:27 -05:00
_Note_: We assume that you use DJB's
[Daemontools ](http://cr.yp.to/daemontools.html ) to start/stop
tinydns. And that your tinydns instance is located in `/service/dns` ,
adjust this path if necessary.
2016-07-26 21:27:12 -05:00
2021-07-18 07:31:09 +01:00
1. Replace your _ log _ 's `run` file, typically located in
2019-07-06 10:51:27 -05:00
`/service/dns/log/run` with:
2019-10-21 02:47:40 +02:00
```bash
2016-07-26 21:27:12 -05:00
#!/bin/sh
exec setuidgid dnslog tinystats ./main/tinystats/ multilog t n3 s250000 ./main/
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
2. Create tinystats directory and chown:
2019-10-21 02:47:40 +02:00
```bash
2016-07-26 21:27:12 -05:00
mkdir /service/dns/log/main/tinystats
chown dnslog:nofiles /service/dns/log/main/tinystats
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
3. Restart TinyDNS and Daemontools: `/etc/init.d/svscan restart`
2019-07-06 10:51:27 -05:00
_ Note _ : Some say `svc -t /service/dns` is enough, on my install
(Gentoo) it doesn't rehook the logging and I'm forced to restart it
entirely.
2016-07-26 21:27:12 -05:00
2021-07-10 03:34:01 +08:00
## Unbound
2016-08-16 10:48:57 -03:00
Unbound configuration:
```text
# Enable extended statistics.
server:
extended-statistics: yes
2016-08-17 09:34:30 -03:00
statistics-cumulative: yes
2017-02-15 01:40:55 +01:00
remote-control:
control-enable: yes
2017-02-15 10:33:03 +01:00
control-interface: 127.0.0.1
2017-02-15 01:40:55 +01:00
2016-08-16 10:48:57 -03:00
```
2019-07-06 10:51:27 -05:00
Restart your unbound after changing the configuration, verify it is
working by running `unbound-control stats` .
2017-03-19 13:03:51 -05:00
2021-07-18 07:31:09 +01:00
### Option 1. SNMP Extend (Preferred and easiest method)
2017-03-19 13:03:51 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, unbound, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/unbound -O /etc/snmp/unbound
```
2017-03-19 13:03:51 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/unbound
```
2017-03-19 13:03:51 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file and add:
2017-03-19 13:03:51 -05:00
```
2020-09-23 23:18:06 +02:00
extend unbound /usr/bin/sudo /etc/snmp/unbound
2017-03-19 13:03:51 -05:00
```
2021-07-18 07:31:09 +01:00
4. Restart snmpd.
2017-03-19 13:03:51 -05:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2021-07-18 07:31:09 +01:00
### Option 2. Agent
2019-07-06 10:51:27 -05:00
[Install the agent ](#agent-setup ) on this device if it isn't already
and copy the `unbound.sh` script to `/usr/lib/check_mk_agent/local/`
2018-05-09 02:15:58 +02:00
2021-07-10 03:34:01 +08:00
## UPS-nut
2016-08-16 10:48:57 -03:00
2016-09-13 05:59:33 +03:00
A small shell script that exports nut ups status.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, unbound, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/ups-nut.sh -O /etc/snmp/ups-nut.sh
```
2019-07-06 10:51:27 -05:00
2021-07-17 22:07:43 +01:00
2. Make the script executable
```
chmod +x /etc/snmp/ups-nut.sh
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-09-13 05:59:33 +03:00
```
2016-09-12 22:17:53 -05:00
extend ups-nut /etc/snmp/ups-nut.sh
2016-09-13 05:59:33 +03:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-03-30 16:11:50 -05:00
2022-06-30 20:42:48 +10:00
Optionally if you have multiple UPS or your UPS is not named APCUPS you can specify its name as an argument into `/etc/snmp/ups-nut.sh`
2021-07-27 09:25:24 +01:00
```
extend ups-nut /etc/snmp/ups-nut.sh ups1
extend ups-nut /etc/snmp/ups-nut.sh ups2
```
2021-07-10 03:34:01 +08:00
## UPS-apcups
2016-09-24 23:49:35 +03:00
A small shell script that exports apcacess ups status.
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
1. Copy the shell script, unbound, to the desired host
2021-07-17 22:07:43 +01:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/ups-apcups -O /etc/snmp/ups-apcups
```
2. Make the script executable
```
chmod +x /etc/snmp/ups-apcups
```
2019-07-06 10:51:27 -05:00
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
2016-09-24 23:49:35 +03:00
```
2018-12-28 20:07:57 -06:00
extend ups-apcups /etc/snmp/ups-apcups
```
If 'apcaccess' is not in the PATH enviromental variable snmpd is
using, you may need to do something like below.
```
extend ups-apcups/usr/bin/env PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin /etc/snmp/ups-apcups
2016-09-24 23:49:35 +03:00
```
2017-03-30 16:11:50 -05:00
2021-07-18 07:31:09 +01:00
4. Restart snmpd on your host
2017-03-30 16:11:50 -05:00
2019-07-06 10:51:27 -05:00
The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
2017-04-27 22:54:39 +03:00
2021-07-10 03:34:01 +08:00
## Voip-monitor
2020-09-18 20:19:20 +05:30
Shell script that reports cpu-load/memory/open-files files stats of Voip Monitor
2021-07-10 03:34:01 +08:00
### SNMP Extend
2020-09-18 20:19:20 +05:30
2021-07-18 07:31:09 +01:00
1. Download the script onto the desired host
2021-07-17 22:07:43 +01:00
```
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/voipmon-stats.sh -O /etc/snmp/voipmon-stats.sh
```
2020-09-18 20:19:20 +05:30
2021-07-18 07:31:09 +01:00
2. Make the script executable
2021-07-17 22:07:43 +01:00
```
chmod +x /etc/snmp/voipmon-stats.sh
```
2020-09-18 20:19:20 +05:30
2021-07-18 07:31:09 +01:00
3. Edit your snmpd.conf file (usually `/etc/snmp/voipmon-stats.sh` ) and add:
2020-09-18 20:19:20 +05:30
```
extend voipmon /etc/snmp/voipmon-stats.sh
```
2021-07-10 03:34:01 +08:00
## ZFS
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
### SNMP Extend
2017-12-30 05:42:51 -06:00
2018-10-19 14:58:58 -07:00
`zfs-linux` requires python3 >=python3.5.
2018-04-11 10:15:05 +02:00
The installation steps are:
2019-07-06 10:51:27 -05:00
1. Copy the polling script to the desired host (the host must be added
to LibreNMS devices)
2021-07-18 07:31:09 +01:00
2. Make the script executable
3. Edit snmpd.conf to include ZFS stats
2019-07-06 10:51:27 -05:00
2021-07-10 03:34:01 +08:00
#### FreeBSD
2017-12-30 05:42:51 -06:00
```
wget https://github.com/librenms/librenms-agent/raw/master/snmp/zfs-freebsd -O /etc/snmp/zfs-freebsd
2018-04-11 10:15:05 +02:00
chmod +x /etc/snmp/zfs-freebsd
echo "extend zfs /etc/snmp/zfs-freebsd" >> /etc/snmp/snmpd.conf
2017-12-30 05:42:51 -06:00
```
2021-07-10 03:34:01 +08:00
#### Linux
2017-12-30 05:42:51 -06:00
```
2018-04-11 10:15:05 +02:00
wget https://github.com/librenms/librenms-agent/raw/master/snmp/zfs-linux -O /etc/snmp/zfs-linux
chmod +x /etc/snmp/zfs-linux
2022-05-11 06:12:41 -05:00
echo "extend zfs /usr/bin/sudo /etc/snmp/zfs-linux" >> /etc/snmp/snmpd.conf
2017-12-30 05:42:51 -06:00
```
2020-05-30 19:19:13 +02:00
Edit your sudo users (usually `visudo` ) and add at the bottom:
```
snmp ALL=(ALL) NOPASSWD: /etc/snmp/zfs-linux
```
2018-04-11 10:15:05 +02:00
Now restart snmpd and you're all set.