Raspberry Pi – how to create a SNMP client configuration for Observium CE 21.10.11666 an intuitive network management and monitoring system

root@rpi-iot-jsho-snmp-01:~# apt-get install snmpd
root@rpi-iot-jsho-snmp-01:~# wget -O /usr/local/bin/distro https://www.observium.org/files/distro
root@rpi-iot-jsho-snmp-01:~# chmod +x /usr/local/bin/distro
root@rpi-iot-jsho-snmp-01:~# cd /etc/snmp
root@rpi-iot-jsho-snmp-01:/etc/snmp# vi snmpd.conf
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
# Full view access
view all included .1
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# Default access to full view
rocommunity JSHO default -V all
# Default access to basic system info
#rocommunity public default -V systemonly
# System contact and location
syslocation Rack/Room/Building, Street, City, Country [GPSX,Y]
syscontact Contact Person <your@email.address>
# Disk Monitoring
disk / 10000
disk /var 5%
includeAllDisks 10%
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro
# This lines allows Observium to detect hardware, vendor and serial
# Common Linux:
# extend .1.3.6.1.4.1.2021.7890.2 hardware /bin/cat /sys/devices/virtual/dmi/id/product_name
# extend .1.3.6.1.4.1.2021.7890.3 vendor /bin/cat /sys/devices/virtual/dmi/id/sys_vendor
# extend .1.3.6.1.4.1.2021.7890.4 serial /bin/cat /sys/devices/virtual/dmi/id/product_serial
# Raspberry Pi:
extend .1.3.6.1.4.1.2021.7890.2 hardware /bin/cat /proc/device-tree/model
extend .1.3.6.1.4.1.2021.7890.4 serial /bin/cat /proc/device-tree/serial
# This line allows Observium to collect an accurate uptime
extend uptime /bin/cat /proc/uptime
# This line enables Observium’s ifAlias description injection
pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/local/bin/ifAlias_persist
root@rpi-iot-jsho-snmp-01:/etc/snmp# systemctl restart snmpd
root@rpi-iot-jsho-snmp-01:/etc/snmp# systemctl status snmpd
root@rpi-iot-jsho-snmp-01:/etc/snmp#

Leave a Reply

You must be logged in to post a comment.