mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: support powerdns-recursor SNMP extend (#6290)
Update direct API access to support version 4 Documentation cleanups
This commit is contained in:
committed by
Neil Lathwood
parent
63533666c9
commit
890350e457
@@ -44,13 +44,17 @@ Either use SNMP extend or use the agent.
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/apache-stats.py -O /etc/snmp/apache-stats.py
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/apache-stats.py)
|
||||
|
||||
3. Verify it is working by running /etc/snmp/apache-stats.py
|
||||
(In some cases urlgrabber needs to be installed, in Debian it can be achieved by: apt-get install python-urlgrabber)
|
||||
|
||||
4. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend apache /etc/snmp/apache-stats.py
|
||||
```
|
||||
|
||||
5. Restart snmpd on your host
|
||||
|
||||
##### Agent
|
||||
@@ -87,39 +91,46 @@ In case you get a `Permission Denied` error, make sure you chown'ed correctly.
|
||||
|
||||
Note: if you change the path you will need to change the path in `scripts/agent-local/bind`.
|
||||
|
||||
|
||||
### DHCP Stats
|
||||
A small shell script that reports current DHCP leases stats.
|
||||
|
||||
##### SNMP Extend
|
||||
1. Copy the shell script to the desired host (the host must be added to LibreNMS devices)
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/dhcp-status.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend dhcpstats /etc/snmp/dhcp-status.sh
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `DHCP Stats` under the Applications tab.
|
||||
|
||||
|
||||
### EXIM Stats
|
||||
SNMP extend script to get your exim stats data into your host.
|
||||
|
||||
##### SNMP Extend
|
||||
1. Copy the [exim stats](https://github.com/librenms/librenms-agent/blob/master/snmp/exim-stats.sh) to `/etc/snmp/` (or any other suitable location) on your host.
|
||||
|
||||
2. Make the script executable: `chmod +x /etc/snmp/exim-stats.sh`
|
||||
|
||||
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
|
||||
```
|
||||
extend exim-stats /etc/snmp/exim-stats.sh
|
||||
```
|
||||
|
||||
4. If you are using sudo edit your sudo users (usually `visudo`) and add at the bottom:
|
||||
```
|
||||
snmp ALL=(ALL) NOPASSWD: /etc/snmp/exim-stats.sh, /usr/bin/exim*
|
||||
```
|
||||
|
||||
5. Restart snmpd on your host
|
||||
|
||||
|
||||
### Fail2ban
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the shell script, fail2ban, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/fail2ban -O /etc/snmp/fail2ban)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/fail2ban)
|
||||
@@ -140,16 +151,13 @@ extend fail2ban /etc/snmp/fail2ban
|
||||
|
||||
7: Restart or reload cron on your system.
|
||||
|
||||
8: On the device page in Librenms, edit your host and check `Fail2ban` under the Applications tab.
|
||||
|
||||
In regards to the totals graphed there are two variables banned and firewalled. Firewalled is a count of banned entries the firewall for fail2ban and banned is the currently banned total from fail2ban-client. Both are graphed as the total will diverge with some configurations when fail2ban fails to see if a IP is in more than one jail when unbanning it. This is most likely to happen when the recidive is in use.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
### FreeBSD NFS Client
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the shell script, fbsdnfsserver, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/fbsdnfsclient -O /etc/snmp/fbsdnfsclient)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/fbsdnfsclient)
|
||||
@@ -161,12 +169,9 @@ extend fbsdnfsclient /etc/snmp/fbsdnfsclient
|
||||
|
||||
4: Restart snmpd on your host
|
||||
|
||||
5: On the device page in Librenms, edit your host and check `FreeBSD NFS Client` under the Applications tab.
|
||||
|
||||
### FreeBSD NFS Server
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the shell script, fbsdnfsserver, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/fbsdnfsserver -O /etc/snmp/fbsdnfsserver)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/fbsdnfsserver)
|
||||
@@ -178,7 +183,6 @@ extend fbsdnfsserver /etc/snmp/fbsdnfsserver
|
||||
|
||||
4: Restart snmpd on your host
|
||||
|
||||
5: On the device page in Librenms, edit your host and check `FreeBSD NFS Server` under the Applications tab.
|
||||
|
||||
### Mailscanner
|
||||
##### SNMP Extend
|
||||
@@ -186,13 +190,16 @@ extend fbsdnfsserver /etc/snmp/fbsdnfsserver
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mailscanner.php -O /etc/snmp/mailscanner.php
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/mailscanner.php)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend mailscanner /etc/snmp/mailscanner.php
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `Mailscanner` under the Applications tab.
|
||||
|
||||
|
||||
### GSPD
|
||||
A small shell script that reports GPSD status.
|
||||
@@ -204,19 +211,22 @@ You may need to configure `$server` or `$port`.
|
||||
|
||||
Verify it is working by running `/usr/lib/check_mk_agent/local/gpsd`
|
||||
|
||||
|
||||
### Memcached
|
||||
##### SNMP Extend
|
||||
1. Copy the [memcached script](https://github.com/librenms/librenms-agent/blob/master/agent-local/memcached) to `/etc/snmp/` on your remote server.
|
||||
|
||||
2. Make the script executable: `chmod +x /etc/snmp/memcached`
|
||||
|
||||
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
|
||||
```
|
||||
extend memcached /etc/snmp/memcached
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check `Memcached` under the Applications tab.
|
||||
|
||||
|
||||
### Munin
|
||||
|
||||
#### Agent
|
||||
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`)
|
||||
@@ -241,18 +251,23 @@ fi
|
||||
echo -n "foobar.value " $(date +%s) #Populate a value, here unix-timestamp
|
||||
```
|
||||
|
||||
### MySQL
|
||||
|
||||
### MySQL
|
||||
##### Agent
|
||||
[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/`
|
||||
|
||||
The MySQL script requires PHP-CLI and the PHP MySQL extension, so please verify those are installed.
|
||||
|
||||
CentOS
|
||||
CentOS (May vary based on PHP version)
|
||||
```
|
||||
yum install php-cli php-mysql
|
||||
```
|
||||
|
||||
Debian (May vary based on PHP version)
|
||||
```
|
||||
apt-get install php5-cli php5-mysql
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```php
|
||||
@@ -264,7 +279,6 @@ $mysql_port = 3306;
|
||||
```
|
||||
|
||||
#### SNMP extend
|
||||
|
||||
1: Copy the mysql script to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/mysql -O /etc/snmp/mysql )
|
||||
|
||||
2: Make the scripts executable (chmod +x /etc/snmp/mysql)
|
||||
@@ -280,23 +294,9 @@ extend mysql /etc/snmp/mysql
|
||||
|
||||
5: Install the PHP CLI language and your MySQL module of choice for PHP.
|
||||
|
||||
7: On the device page in Librenms, edit your host and check `MySQL` under the Applications tab
|
||||
|
||||
#### Agent
|
||||
[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/`
|
||||
|
||||
The MySQL script requires PHP-CLI and the PHP MySQL extension, so please verify those are installed.
|
||||
|
||||
CentOS
|
||||
```
|
||||
yum install php-cli php-mysql
|
||||
```
|
||||
|
||||
Debian
|
||||
```
|
||||
apt-get install php5-cli php5-mysql
|
||||
```
|
||||
|
||||
Make sure you set hostname, user, and pass are properly set in `/usr/lib/check_mk_agent/local/mysql.cnf
|
||||
|
||||
Verify it is working by running `/usr/lib/check_mk_agent/local/mysql`
|
||||
@@ -305,9 +305,6 @@ Verify it is working by running `/usr/lib/check_mk_agent/local/mysql`
|
||||
### NGINX
|
||||
NGINX is a free, open-source, high-performance HTTP server: https://www.nginx.org/
|
||||
|
||||
##### Agent
|
||||
[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/`
|
||||
|
||||
It's required to have the following directive in your nginx configuration responsible for the localhost server:
|
||||
|
||||
```text
|
||||
@@ -319,6 +316,24 @@ location /nginx-status {
|
||||
}
|
||||
```
|
||||
|
||||
##### SNMP Extend
|
||||
1. Download the script onto the desired host (the host must be added to LibreNMS devices)
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/nginx-stats -O /etc/snmp/nginx-stats
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/nginx-stats)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend nginx /etc/snmp/nginx-stats
|
||||
```
|
||||
4. Restart snmpd on your host
|
||||
|
||||
##### Agent
|
||||
[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/`
|
||||
|
||||
|
||||
### NTP Client
|
||||
A shell script that gets stats from ntp client.
|
||||
|
||||
@@ -327,13 +342,15 @@ A shell script that gets stats from ntp client.
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/ntp-client.sh -O /etc/snmp/ntp-client.sh
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/ntp-client.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend ntp-client /etc/snmp/ntp-client.sh
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `NTP Client` under the Applications tab.
|
||||
|
||||
### NTP Server (NTPD)
|
||||
A shell script that gets stats from ntp server (ntpd).
|
||||
@@ -343,18 +360,18 @@ A shell script that gets stats from ntp server (ntpd).
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/ntp-server.sh -O /etc/snmp/ntp-server.sh
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/ntp-server.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend ntp-server /etc/snmp/ntp-server.sh
|
||||
```
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `NTP Server` under the Applications tab.
|
||||
|
||||
|
||||
### Nvidia GPU
|
||||
|
||||
##### SNMP Extend
|
||||
|
||||
1: Copy the shell script, nvidia, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/nvidia -O /etc/snmp/nvidia)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/nvidia)
|
||||
@@ -368,8 +385,6 @@ extend nvidia /etc/snmp/nvidia
|
||||
|
||||
6: Verify you have nvidia-smi installed, which it generally should be if you have the driver from Nvida installed.
|
||||
|
||||
7: On the device page in Librenms, edit your host and check `Nvidia` under the Applications tab.
|
||||
|
||||
The GPU numbering on the graphs will correspond to how the nvidia-smi sees them as being.
|
||||
|
||||
For questions about what the various values are/mean, please see the nvidia-smi man file under the section covering dmon.
|
||||
@@ -384,63 +399,63 @@ For pacman users automatically refreshing the database, it is recommended you us
|
||||
```
|
||||
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/os-updates.sh -O /etc/snmp/os-updates.sh
|
||||
```
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/os-updates.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend osupdate /etc/snmp/os-updates.sh
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `OS Updates` under the Applications tab.
|
||||
|
||||
_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.
|
||||
|
||||
|
||||
### PHP-FPM
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1. Copy the shell script, phpfpm-sp, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/phpfpm-sp -O /etc/snmp/phpfpm-sp)
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/phpfpm-sp)
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/phpfpm-sp) and add:
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend phpfpmsp /etc/snmp/phpfpm-sp
|
||||
```
|
||||
5: Edit /etc/snmp/phpfpm-sp to include the status URL for the PHP-FPM pool you are monitoring.
|
||||
6. Restart snmpd on your host
|
||||
7. On the device page in Librenms, edit your host and check `PHP-FPM` under the Applications tab.
|
||||
|
||||
It is worth noting that this only monitors a single pool. If you want to monitor multiple pools, this won't do it.
|
||||
|
||||
### Postfix
|
||||
|
||||
### Postfix
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the shell script, postfix-queues, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/postfix-queues -O /etc/snmp/postfix-queues)
|
||||
|
||||
1: Copy the Perl script, postfix-queues, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/postfixdetailed -O /etc/snmp/postfixdetailed)
|
||||
2: Copy the Perl script, postfixdetailed, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/postfixdetailed -O /etc/snmp/postfixdetailed)
|
||||
|
||||
2: Make the scripts executable (chmod +x /etc/snmp/postfixdetailed /etc/snmp/postfix-queues)
|
||||
3: Make the scripts executable (chmod +x /etc/snmp/postfixdetailed /etc/snmp/postfix-queues)
|
||||
|
||||
3: Edit your snmpd.conf file and add:
|
||||
4: Edit your snmpd.conf file and add:
|
||||
```
|
||||
extend mailq /etc/snmp/postfix-queues
|
||||
extend postfixdetailed /etc/snmp/postfixdetailed
|
||||
```
|
||||
|
||||
4: Restart snmpd.
|
||||
5: Restart snmpd.
|
||||
|
||||
5: Install pflogsumm for your OS.
|
||||
6: Install pflogsumm for your OS.
|
||||
|
||||
6: Make sure the cache file in /etc/snmp/postfixdetailed is some place 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.
|
||||
|
||||
7: On the device page in Librenms, edit your host and check `Postfix` under the Applications tab. Before doing this, run /etc/snmp/postfixdetailed to create the initial cache file so you don't end up with some crazy initial starting value.
|
||||
7: Make sure the cache file in /etc/snmp/postfixdetailed is some place 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.
|
||||
|
||||
8: Run /etc/snmp/postfixdetailed to create the initial cache file so 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.
|
||||
|
||||
|
||||
### Postgres
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the shell script, postgres, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/postgres -O /etc/snmp/postgres)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/postgres)
|
||||
@@ -458,26 +473,39 @@ extend postgres /etc/snmp/postgres
|
||||
|
||||
7: If you wish it to ignore the database postgres for totalling up the 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.
|
||||
|
||||
8: On the device page in Librenms, edit your host and check `Postgres` under the Applications tab.
|
||||
|
||||
### PowerDNS
|
||||
An authoritative DNS server: https://www.powerdns.com/auth.html
|
||||
#### SNMP Extend
|
||||
|
||||
##### Agent
|
||||
[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/`
|
||||
|
||||
|
||||
### PowerDNS Recursor
|
||||
A recursive DNS server: https://www.powerdns.com/recursor.html
|
||||
|
||||
##### Direct
|
||||
#### Direct
|
||||
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
|
||||
|
||||
###### Variables
|
||||
##### Variables
|
||||
`$config['apps']['powerdns-recursor']['api-key']` required, this is defined in the Recursor config
|
||||
`$config['apps']['powerdns-recursor']['port']` numeric, defines the port to connect to PowerDNS Recursor on. The default is 8082
|
||||
`$config['apps']['powerdns-recursor']['https']` true or false, defaults to use http.
|
||||
|
||||
#### SNMP Extend
|
||||
1: Copy the shell script, postgres, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns-recursor -O /etc/snmp/powerdns-recursor)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/powerdns-recursor)
|
||||
|
||||
3: Edit your snmpd.conf file and add:
|
||||
```
|
||||
extend powerdns-recursor /etc/snmp/powerdns-recursor
|
||||
```
|
||||
|
||||
4: Restart snmpd on your host
|
||||
|
||||
##### Agent
|
||||
[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/`
|
||||
|
||||
@@ -486,33 +514,39 @@ This script uses `rec_control get-all` to collect stats.
|
||||
### Proxmox
|
||||
1. Download the script onto the desired host (the host must be added to LibreNMS devices)
|
||||
`wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /usr/local/bin/proxmox`
|
||||
|
||||
2. Make the script executable: `chmod +x /usr/local/bin/proxmox`
|
||||
|
||||
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
|
||||
`extend proxmox /usr/local/bin/proxmox`
|
||||
(Note: if your snmpd doesn't run as root, you might have to invoke the script using sudo. `extend proxmox /usr/bin/sudo /usr/local/bin/proxmox`)
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check `Proxmox` on the Applications tab.
|
||||
|
||||
|
||||
### Raspberry PI
|
||||
SNMP extend script to get your PI data into your host.
|
||||
|
||||
##### SNMP Extend
|
||||
1. Copy the [raspberry script](https://github.com/librenms/librenms-agent/blob/master/snmp/raspberry.sh) to `/etc/snmp/` (or any other suitable location) on your PI host.
|
||||
|
||||
2. Make the script executable: `chmod +x /etc/snmp/raspberry.sh`
|
||||
|
||||
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
|
||||
```
|
||||
extend raspberry /etc/snmp/raspberry.sh
|
||||
```
|
||||
|
||||
4. Edit your sudo users (usually `visudo`) and add at the bottom:
|
||||
```
|
||||
snmp ALL=(ALL) NOPASSWD: /etc/snmp/raspberry.sh, /usr/bin/vcgencmd*
|
||||
```
|
||||
|
||||
5. Restart snmpd on PI host
|
||||
|
||||
|
||||
### SMART
|
||||
|
||||
#### SNMP Extend
|
||||
|
||||
1: Copy the Perl script, smart, to the desired host (the host must be added to LibreNMS devices) (wget https://github.com/librenms/librenms-agent/raw/master/snmp/smart -O /etc/snmp/smart)
|
||||
|
||||
2: Make the script executable (chmod +x /etc/snmp/smart)
|
||||
@@ -544,8 +578,6 @@ it should be. This will result in a usable config, but may miss some less common
|
||||
|
||||
5: Restart snmpd on your host
|
||||
|
||||
6: On the device page in Librenms, edit your host and check `SMART` under the Applications tab.
|
||||
|
||||
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.
|
||||
```
|
||||
*/3 * * * * /etc/snmp/smart -u
|
||||
@@ -571,8 +603,6 @@ snmp_access deny all
|
||||
proxy -v 2c -c public 127.0.0.1:3401 1.3.6.1.4.1.3495
|
||||
```
|
||||
|
||||
4: On the device page in Librenms, edit your host and check `Squid` under the Applications tab.
|
||||
|
||||
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
|
||||
@@ -591,11 +621,13 @@ And that your tinydns instance is located in `/service/dns`, adjust this path if
|
||||
#!/bin/sh
|
||||
exec setuidgid dnslog tinystats ./main/tinystats/ multilog t n3 s250000 ./main/
|
||||
```
|
||||
|
||||
2. Create tinystats directory and chown:
|
||||
```shell
|
||||
mkdir /service/dns/log/main/tinystats
|
||||
chown dnslog:nofiles /service/dns/log/main/tinystats
|
||||
```
|
||||
|
||||
3. Restart TinyDNS and Daemontools: `/etc/init.d/svscan restart`
|
||||
_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.
|
||||
|
||||
@@ -633,30 +665,36 @@ extend unbound /etc/snmp/unbound
|
||||
|
||||
4: Restart snmpd.
|
||||
|
||||
5: On the device page in Librenms, edit your host and check `Unbound` under the Applications tab.
|
||||
|
||||
### UPS-nut
|
||||
A small shell script that exports nut ups status.
|
||||
|
||||
##### SNMP Extend
|
||||
1. Copy the [ups nut](https://github.com/librenms/librenms-agent/blob/master/snmp/ups-nut.sh) to `/etc/snmp/` on your host.
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/ups-nut.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend ups-nut /etc/snmp/ups-nut.sh
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
5. On the device page in Librenms, edit your host and check the `UPS nut` under the Applications tab.
|
||||
|
||||
|
||||
### UPS-apcups
|
||||
A small shell script that exports apcacess ups status.
|
||||
|
||||
##### SNMP Extend
|
||||
1. Copy the [ups apcups](https://github.com/librenms/librenms-agent/blob/master/snmp/ups-apcups.sh) to `/etc/snmp/` on your host.
|
||||
|
||||
2. Make the script executable (chmod +x /etc/snmp/ups-apcups.sh)
|
||||
|
||||
3. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:
|
||||
```
|
||||
extend ups-apcups /etc/snmp/ups-apcups.sh
|
||||
```
|
||||
|
||||
4. Restart snmpd on your host
|
||||
|
||||
5. On the device page in Librenms, edit your host and check the `UPS apcups` under the Applications tab.
|
||||
|
@@ -46,7 +46,14 @@ if ($agent_data['app'][$name]) {
|
||||
|
||||
d_echo("\nNo Agent Data. Attempting to connect directly to the powerdns-recursor server $scheme" . $device['hostname'] . ":$port\n");
|
||||
$context = stream_context_create(array('http' => array('header' => 'X-API-Key: ' . $config['apps'][$name]['api-key'])));
|
||||
$data = file_get_contents($scheme . $device['hostname'] . ':' . $port . '/servers/localhost/statistics', false, $context);
|
||||
$data = file_get_contents($scheme . $device['hostname'] . ':' . $port . '/api/v1/servers/localhost/statistics', false, $context);
|
||||
if ($data === false) {
|
||||
$data = file_get_contents($scheme . $device['hostname'] . ':' . $port . '/servers/localhost/statistics', false, $context);
|
||||
}
|
||||
} else {
|
||||
// nsExtendOutputFull."powerdns-recursor"
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.17.112.111.119.101.114.100.110.115.45.114.101.99.117.114.115.111.114';
|
||||
$data = snmp_get($device, $oid, '-Oqv');
|
||||
}
|
||||
|
||||
if (!empty($data)) {
|
||||
|
Reference in New Issue
Block a user