Skip to content

Distro script

Distribution Detection

Linux/Unix distribution detection is remarkably simple.

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

  2. You can fetch the latest version of the distro script with one of the following commands:

    sudo curl -o /usr/local/bin/distro https://www.observium.org/files/distro
    sudo wget -O /usr/local/bin/distro https://www.observium.org/files/distro
    
  3. Make the script executable:

    sudo chmod +x /usr/local/bin/distro
    
  4. 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
    
  5. 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
    
  6. 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"