Linux

Example Net-SNMP Configuration

This can be placed in /etc/snmp/snmpd.config and will provide the required parameters for Observium.

   com2sec readonly  default         community_string

   group MyROGroup v1         readonly
   group MyROGroup v2c        readonly
   group MyROGroup usm        readonly
   view all    included  .1                               80
   access MyROGroup ""      any       noauth    exact  all    none   none
   syslocation Location, City, CC
   syscontact Contact Person <user@domain.com>

   # 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/bin/distro

   # This line enables Observium's ifAlias description injection
   pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/bin/ifAlias_persist

Distribution Detection Support

Linux/Unix distribution detection is remarkably simple.

Put the scripts/distro file from your Observium installation into /usr/bin/distro on the device to be monitored.

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/bin/distro

Restart the SNMP daemon!

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/bin/distro

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/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/bin/ifAlias_persist), then add this into your snmpd.conf:

pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/bin/ifAlias_persist

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!)