updated README.md

This commit is contained in:
in-famous-raccoon
2022-04-03 15:35:24 +02:00
parent 50fde6ee7e
commit 9b3725464b
2 changed files with 40 additions and 40 deletions

View File

@ -1,33 +1,35 @@
# Configuration on Proxmox Host
# Configuration on Proxmox
## Install snmpd
apt install snmpd
### Install snmpd
`apt install snmpd`
## Configure snmpd
#### Edit /etc/snmp/snmpd.conf
### Configure snmpd
#### Paste content from snmpd.conf to /etc/snmp/snmpd.conf
`nano /etc/snmp/snmpd.conf`
#### Add basic configuration
### Paste content from sh file to /opt folder and make executable
`nano /opt/snmp-cpu-temp.sh`<br/>
`chmod +x /opt/snmp-cpu-temp.sh`
### Run snmpd as root, because debian added the user "Debian-snmp" to the snmp.service but for SMART/LVM Status we need to be root.
#### edit snmpd.service and replace "Debian-snmp" with "root"
`nano /lib/systemd/system/snmpd.service`
##### From
```
#Listen on all interfaces, IPv4 only
agentAddress udp:161
#ACCESS CONTROL
view all included .1.3.6.1.2.1.1
view all included .1.3.6.1.2.1.25.1
#SNMP v2 (Read only) with community "public" restricted to Network
#Please change IP 192.168.1.0/24 to your Network.
rocommunity public 192.168.1.0/24
sysLocation YourCity
sysContact YourName
#Run as root
agentuser root
#Add commands
pass .1.3.6.1.2.1.25.1.8 /bin/sh /root/snmp-cpu-temp.sh
pass .1.3.6.1.2.1.25.1.9 /bin/sh /root/snmp-lvm-used.sh
pass .1.3.6.1.2.1.25.1.10 /bin/sh /root/snmp-smart-status.sh
...
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f -p /run/snmpd.pid
...
```
##### To
```
...
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u root -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f -p /run/snmpd.pid
...
```
#### Restart SNMPD
`systemctl restart snmpd.service`
# Configuration on PRTG WebUI
#### CPU temperature
* Add sensor
@ -54,21 +56,3 @@ pass .1.3.6.1.2.1.25.1.10 /bin/sh /root/snmp-smart-status.sh
* Response Must Include (Warning Status) = PASSED
![PRTG](https://i.postimg.cc/DZNMD74V/PRTG.png)
# Known issues
#### Recently debian added the user "Debian-snmp" to the snmp.service but for SMART/LVM Status we need the root user.
#### edit snmpd.service and replace "Debian-snmp" with "root"
`nano /lib/systemd/system/snmpd.service`
##### From
```
...
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f -p /run/snmpd.pid
...
```
##### To
```
...
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u root -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f -p /run/snmpd.pid
...
```