This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How Can I poll the OS version for Linux Servers?


Is there an easy way to display the OS version for my Linux servers?

Machine Type only displays net-snmp - Linux

Operating System is blank

  • I was going to ask the same thing , but I dont think its an easy solution as the information is not being passed via SNMP - anyone else have an idea ..

    I assume just by adding a custom property ?

  • I'm going to give a high-level answer and if you need details, let me know and I'll hunt down some more specifics tomorrow:

    1. play with the following commands (and parameters) until you get what you want:
      1. uname -a, or uname -o or uname -v
      2. lsb_release -a
      3. cat /proc/version
      4. cat /etc/*-release
    2. modify your snmp agent so that the oid 9.9.9.9.9.9.1 runs the command you finally settle on from testing above
    3. Using the ability to use a different OID for the system ID (introduced in NPM 11.5), you can now identify your specific machine type (Ubuntu, Suse, etc)
  • thanks that would be great .. thanks Leon

    Is this an area that is going to be addressed in future release 

  • Here are some instructions that go more in-depth.

    1. Set up the command that gets you the OS info you want
      As described above, you might use uname, or lsb_release, or some other method. The upshot is that you want the command to output the OS name. For example the two commands I tried out where:
      1. Ubuntu: uname -v | awk '{ print $1 }'
      2. SuSe: lsb_release -d | awk '{ print $2, $4, $5, $6}'
    2. Create a script and roll it out to all systems
      Once you have a script that works (even if it's different for different Unix/Linux flavors), create a script (or scripts) that do that command. For example:
      #!/bin/bash
      uname -v | awk '{ print $1 }'
      then place this script in the SAME DIRECTORY on all systems. So it doesn't matter if the SuSe version does different commands than it's Ubuntu counterpart. It matters that it's always called /usr/bin/osname.sh
    3. Add that script to your SNMPD.CONF file
      in your /etc/snmp/snmpd.conf file, add the following line:
      extend osname /usr/bin/osname.sh
      you'll need to restart the snmp service each time you make this update.
    4. 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>
      and once you don't get errors, try:
      snmpwalk -v2c -c <rocommunity> <hostname> NET-SNMP-EXTEND-MIB::nsExtendObjects
      and finally:
      snmpwalk -v2c -c <rocommunity> <hostname> NET-SNMP-EXTEND-MIB::nsExtendOutLine.\"osname\".1
    5. test some more
      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
    6. roll that out to all systems
      Now that you have the snmpd.conf file working, roll it out to all your other *nix systems as well.
    7. Add that poller to NPM 11.5
      Go to Settings, Manager Pollers, and create a new poller.
      1. Technology is "Node Details"
      2. On the next screen, you'll select "MachineType" and define a new data source
        1. Cancel out of the "Set a constant value"
        2. Click "Select an OID"
        3. Scroll to the bottom and check the "Looking for an OID..." box
        4. Give the OID a name (I like "osname")
        5. 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.
      3. Also note you have to pick a new SysObjectID - which I hard-coded as "Linux-SuSe" (or Linux-Ubuntu)
    8. Did I mention you should test this a few times?
    9. Roll out the new poller to the appropriate *nix devices in your environment
  • Few more notes:

    #!/bin/bash requires bash to be in path environment (which in some specific distributions is not) so I would suggest to replace it with: #!/usr/bin/env bash (all new distros are already using it and in old it will work as well).

    Also there is no specific commnad how to find out the distro name - all the command mentioned here can work only on specific servers. I can try to produce some script but I need some time to tune it. So if you can wait I will try to provide it by tomorrow (II can't promise though becasue this is not really so trivial task).

  • Adding your own custom NodeDetails poller means you can no longer use the default SolarWinds NodeDetails poller, so while you gain the advantage of knowing the Vendor, the node loses all the other details.

    EG: the default node details widget shows:

    System Name

    Description

    Location

    Contact

    ...and all the various other OIDs in the native NodeDetails poller.

    But, if you create your own custom NodeDetails poller, you have to re-create all those other attributes too! You can't Duplicate-and-Edit the native SolarWinds NodeDetails poller, even when it's unassigned.

    emoticons_sad.png

    pastedImage_0.png

    ...and, even worse, it means I lose the "Real Time Process Explorer" link (in the default management widget (of the Summary Tab (of the Node Details page))).

    pastedImage_0.png

  • Yes learned the hard way on that ..

  • SAM 6.3 Beta 2 is now available which includes a Linux Agent for Node, Volume, Interface, and Application monitoring. This agent should address many of the shortcomings associated with monitoring Linux host via SNMP, up to and including properly reflecting the Linux distribution and version running. If you already own Server & Application Monitor and are under active maintenance, you can sign-up to participate in the beta at the link below.

  • How well are the Linux agents working across the various flavors to pull normal data + OS Version details separated?

  • The Linux Agent does a better job and collects more data than SNMP.