Installing, Configuring and Enabling SNMP on Turbonomic and Linux VMs

This tutorial outlines how to Install, Configure and Enable SNMP on a Turbonomic instance and Linux Virtual Machines. This is a document I wrote over at the Turbonomic Green Circle Community.

The instructions cover how to setup Linux-based VMs that are under Turbonomic’s control including those running in the Public Cloud.  This process has been used when unable to use Public Cloud providers tools when gathering Memory metrics.

Picture1

I have split this document into the following sections:

  • Turbonomic SNMP Installation and Configuration
  • Linux Virtual Machine Installation and Configuration
  • Turbonomic SNMP Target configuration
  • Cloud configuration considerations and screenshots
  • Basic vi commands

Turbonomic SNMP Installation and Configuration process:

1.Login to the Turbo Instance with root credentials

2. To Install SNMP agent and Utils, run the following command:

 yum -y install net-snmp net-snmp-utils

3. To configure the SNMP agent type:

snmpconf -i

4. For the following prompts, enter the responses highlighted in Bold:

        - Valid answer examples: "all", "none","3","1,2,5"
         Read in which (default = all): all

         - Select the file type you wish to create:
         (you can create more than one as you run this program)
            1:snmptrapd.conf
            2:snmp.conf
            3:snmpd.conf
         Select File: select snmpd.conf

        - Select a configuration section for snmpd.conf that you wish to create:
            1:Extending the Agent
            2:Trap Destinations
            3:Agent Operating Mode
            4:Monitor Various Aspects of the Running Host
            5:System Information Setup
            6:Access Control Setup
         Select section: select Access Control Setup

        - This section defines who is allowed to talk to your running snmp agent. Select from:
            1:a SNMPv3 read-write user
            2:a SNMPv3 read-only user
            3:a SNMPv1/SNMPv2c read-only access community name
            4:a SNMPv1/SNMPv2c read-write access community name
         Select section: 3
 
       - The community name to add read-only access for: Turbonomic
(or choose your own community name, this needs to be the same across VMs and when added as a Target in Turbo)

       - The hostname or network address to accept this community name from [RETURN for all]:

       - The OID that this community should be restricted to [RETURN for no-restriction]:

       - For the next 3 prompts, type the following responses:
            finished
            finished
            quit

 

NOTE:  We have found that sometimes the Community String entered does not stay in the snmpd.conf file after running the snmpconf -I command.  We will need to manually add this.

5. To do this type:

   sudo vi /etc/snmp/snmpd.conf

6. Scroll down to the section where the Community string is entered. If this state’s turbonomic (Or whatever you entered for the Community string) you can quit out of this.  If not, change the word public to your Community (in this example it is turbonomic) and Write out the file.

NOTE: See section on basic VI commands for assistance with this

Picture2

7. Restart the SNMP daemon

   snmpd restart

Linux Virtual Machine Installation and Configuration process:

In this example I am using a CentOS VM, howver the process will be similar for other flavours of Linux, but you will need to use APT or Zypper etc for the installation).

1. Login to the Turbo Instance with root credentials

2. To Install SNMP agent and Utils, run the following command:

 yum -y install net-snmp net-snmp-utils

NOTE:  As there are a few additional lines which need to be added/amended in the Conf file, I have attached a version to this Doc which I know works.

3. Delete the contents of the current snmpd.conf file and replace with the contents of the Txt file attached. Exit and Write the file

4. Restart theSNMP daemon

snmpd restart

Turbonomic Target SNMP Configuration

All SNMP enabled workloads need to be in a Group, currently Turbonomic recommends that a single scope contain no more than 500 virtual machines. Multiple targets should be used for environments exceeding this limit.

Once the relevant Group/s have been created, we can go ahead and add the SNMP Target.

1. Navigate to Settings > Target Configuration > Add Target

2. Select Guest OS Processes and SNMPPicture3

3. Enter: Target Name, Scope and Community details and select Add

Picture4

Cloud configuration considerations and screenshots

  • SNMP will by default use Port 161 (UDP) and as such this will need to be opened on Internal / External Firewalls and needs to be taken into consideration
  • AWS: Security Groups need to be created or amended to allow these Ports
  • Azure: Allow ports directly to the VM or create Network Security Groups/Rules – This is just an example:

Picture8

SNMP Testing

To test Connectivity from Turbo to the CentOS:

snmpwalk -Os -v 2c -c   iso.3.6.1.2.1.1.1

Expected Output should show Kernel Version:

Picture6

To test Memory Metrics are returning:

snmpwalk -v 2c -c   1.3.6.1.4.1.2021.4

Expected Output should show some Memory stats:

Picture7

Basic vi commands

  • /                        Perform search for Text entered
  • i                                   Insert Mode to edit the file
  •                            Quit Insert Mode
  • :q!                                Close file without savings
  • :wq!                             Close file and Write Changes
  • dG                               Delete all lines
  • gg                                Move cursor to first line of file
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s