Network Management

Change the Machine Type other than NET-SNMP for Linux devices

This articles describes how to change the Machine Type listed for a Linux device to something other than Net-SNMP. The steps will show how to: set up a script on the target node (ultimately this will exist on ALL your target nodes) that responds to the command "osname" with the actual distribution and version. edit the net-snmp config to run that script when a specific OID is polled, and assign that OID in NPM to replace the existing machine type.

First published date

10/17/2018 2:53 PM

Last published date

10/11/2021 1:27 PM

Overview

This articles describes how to change the Machine Type listed for a Linux device to something other than Net-SNMP.

The steps will show how to:

  • set up a script on the target node (ultimately this will exist on ALL your target nodes) that responds to the command "osname" with the actual distribution and version.
  • edit the net-snmp config to run that script when a specific OID is polled, and
  • assign that OID in NPM to replace the existing machine type.

Product section

Network Performance Monitor

Resolution

Note: See the More Net-SNMP Nodes Thwack post for any updates.

Step 1 -  Get Scripting!

  1. Depending on your distribution, you might use uname, or lsb_release, or some other methods. The upshot is that you want the command to output the OS name. For example the two commands I tried out were:
    Ubuntu: uname -v | awk '{ print $1 }'
    SuSe: lsb_release -d | awk '{ print $2, $4, $5, $6}'
  1. Create a script and roll it out to all systems
  2. Once you have a script that works (even if it's different for different Unix/Linux flavors), create a script (or scripts) that does that command. For example:
    #!/bin/bash
    uname -v | awk '{ print $1 }'
  3. Then place this script in the SAME DIRECTORY on all systems. So it doesn't matter if the SuSe version does different commands than its Ubuntu counterpart. It matters that it's always called /usr/bin/osname.sh

 

Step 2 - Update your SNMP configuration

  1. in /etc/snmp/snmpd.conf file, add the following line:
    extend osname /usr/bin/osname.sh
  2. restart the snmp service each time you make this update.
  3. test test test! This is going to involve running "snmpwalk" a lot to make sure you can get SNMP to display this new value. Start with:
    snmpwalk -v2c -c <rocommunity> <hostname> 
  4. once you do not get errors, try:
    snmpwalk -v2c -c <rocommunity> <hostname> NET-SNMP-EXTEND-MIB::nsExtendObjects
  5. and finally:
    snmpwalk -v2c -c <rocommunity> <hostname> NET-SNMP-EXTEND-MIB::nsExtendOutLine.\"osname\".1
  6. Test some more
  7. Once that works, you'll need to get the OID of your new object. While you can use "snmptranslate" for that, you may be better off using the snmpwalk.exe utility built into SolarWinds. That will also verify that you can walk this new object FROM the SolarWinds poller. It's typically found in:
    C:\program files(x86)\solarwinds\orion\snmpwalk.exe
  8. Roll that change out to all systems
  9. Now that you have the snmpd.conf file working, roll it out to all your other *nix systems as well.

 

Add the poller to NPM

  1. Go to Settings-> All Settings-> Manage Pollers, and create a new poller.
  2. On the field Technology select "Node Details"
  3. On the next screen, you'll select "MachineType" and define a new data source
  4. Cancel out of the "Set a constant value"
  5. Click "Select a Object Identifier(OID)"
  6. Scroll to the bottom and check the "Looking for an OID..." box
  7. Give the OID a name (I like "osname")
  8. Enter the actual OID you discovered in step 4 above. It may take some trial and error since the snmpwalk is going to provide a VERY long number. You will take a portion of it. On my system, I grabbed 1.3.6.1.4.1.8072.1.3.2.3.1.1.
  9. Also, note you have to pick a new SysObjectID - which I hard-coded as "Linux-SuSe" (or Linux-Ubuntu)
  10. Did I mention you should test this a few times?
  11. Apply the new poller to the appropriate *nix devices in your environment