Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

SNMP Client Configuration for Observvium

Rumi, November 10, 2019

This can be placed in /etc/snmp/snmpd.conf and will provide the required parameters for Observium. This example use version 2c snmp auth.

Community string: Replace community_string with your unique community string.

# 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 community_string 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
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

# 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

Accurate Uptime

The pre-existing uptime values available via Net-SNMP are either inaccurate or will wrap after 1.5 years. To work around this we check for an entry in net-snmp’s extend table for a custom uptime value.

Add this to /etc/snmp/snmpd.conf of the device being monitored and restart snmpd.

extend uptime /bin/cat /proc/uptime

This is not required when using the Unix Agent.

Distribution Detection
Linux/Unix distribution detection is remarkably simple.

Put the scripts/distro file from your Observium installation into /usr/local/bin/distro on the device to be monitored.
You can fetch latest version of distro script by:

sudo curl -o /usr/local/bin/distro https://gitlab.com/observium/distroscript/raw/master/distro

or

sudo wget -O /usr/local/bin/distro https://gitlab.com/observium/distroscript/raw/master/distro

make script executable:

sudo chmod +x /usr/local/bin/distro

Add this to the /etc/snmp/snmpd.conf file of the device to be monitored. This is already in the example configuration file above.

extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro

If your snmpd does not like the extend line (this problem was observed on a particular version), you can also add this to the snmpd.conf file of the device to be monitored:

exec .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro

Restart the SNMP daemon!

sudo service snmpd restart

Hardware/Vendor Detection- Minimum version

This feature available since version 19.2.9717
Mostly Linux/distributions already store system hardware, vendor and serial in /sys virtual filesystem.

Add this lines to the /etc/snmp/snmpd.conf for enable detection it:

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

Serial permissions

In some environments snmpd not have permission for read file /sys/devices/virtual/dmi/id/product_serial. Need to change file permission at boot by adding this command to /etc/rc.local: chmod 444 /sys/devices/virtual/dmi/id/product_serial
Restart the SNMP daemon!

sudo service snmpd restart

Testing

You can test the script by walking the OID on the system:

snmpwalk -v2c -c <community> <hostname> .1.3.6.1.4.1.2021.7890.1

You should see output similar to the below :

UCD-SNMP-MIB::ucdavis.7890.1.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.7890.1.2.1.2.6.100.105.115.116.114.111 = STRING: "/usr/bin/distro"
UCD-SNMP-MIB::ucdavis.7890.1.2.1.3.6.100.105.115.116.114.111 = ""
UCD-SNMP-MIB::ucdavis.7890.1.2.1.4.6.100.105.115.116.114.111 = ""
UCD-SNMP-MIB::ucdavis.7890.1.2.1.5.6.100.105.115.116.114.111 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.7890.1.2.1.6.6.100.105.115.116.114.111 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.7890.1.2.1.7.6.100.105.115.116.114.111 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.7890.1.2.1.20.6.100.105.115.116.114.111 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.7890.1.2.1.21.6.100.105.115.116.114.111 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.7890.1.3.1.1.6.100.105.115.116.114.111 = STRING: "Linux|4.10.0-20-generic|amd64|Ubuntu|17.04|none"
UCD-SNMP-MIB::ucdavis.7890.1.3.1.2.6.100.105.115.116.114.111 = STRING: "Linux|4.10.0-20-generic|amd64|Ubuntu|17.04|none"
UCD-SNMP-MIB::ucdavis.7890.1.3.1.3.6.100.105.115.116.114.111 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.7890.1.3.1.4.6.100.105.115.116.114.111 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.7890.1.4.1.2.6.100.105.115.116.114.111.1 = STRING: "Linux|4.10.0-20-generic|amd64|Ubuntu|17.04|none"

Using ifAlias Support¶
If you would like to put descriptions on your interfaces on Debian GNU/Linux or one of its derivatives, you can use the script provided in scripts/snmp-extend/ifAlias_persist

Install additional package (for Debian/Ubuntu):

sudo apt-get install libsnmp-extension-passpersist-perl

Save it somewhere on the systems you want to return ifAliases (i.e. /usr/local/bin/ifAlias_persist), then add this into your snmpd.conf:

pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/local/bin/ifAlias_persist

Restart the SNMP daemon!

sudo service snmpd restart

Now you can put the descriptions into /etc/network/interfaces:

# eth0: Transit: YourISP Inc. Leased Line
iface eth0 inet static
# ....

On the next poll, Observium should then pick up your descriptions. (Don’t forget to restart snmpd after changing the configuration!)

Src: https://docs.observium.org/device_linux/

Administrations Configurations (Linux) NMSObserviumSNMPSNMP v2c

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes