SNMP Agent Setup

From OSNEXUS Online Documentation Site
Jump to: navigation, search

Quanastor SNMP Agent

The QuantaStor SNMP agent provides the ability to collect SNMP traps and to browse the objects within a QuantaStor grid via SNMP GET operations. Note that the SNMP agent has no SNMP SET operations and does not allow one to change the configuration of a QuantaStor System or grid via SNMP. To make automated configuration changes please see the REST APIs in the QuantaStor Developer Guide.

SNMP MIB

The full down load can be found at SNMP MIB for QuantaStor. The latest version for any given release can be found by running qs-util snmpmib after logging into an system via SSH.

SNMP Agent Configuration For Quantastor Version 6.1 and greater

SNMP Agent can now be configured in a few click from the Alert Manager in the Quantastor Web UI. In the SNMP tab check "Enable SNMP". Choose a SNMP user name and password. These credentials will be used by the SNMP Agent to communicate with the Quantastor Service. After clicking OK, SNMP Agent will be configured on the Quantastor Systems in the grid.

To change the SNMP user password, open the Alert Manager and select the "SNMP" tab. Enter the new password and click OK. SNMP Agent will be reconfigured with the new password. To disable the SNMP agent, simply uncheck the option "Enable SNMP".

SNMP Agent Configuration For Quantastor Version older than 6.1

For SNMP setup steps on Quantastor Versions older than 6.1 please visit the SNMP Agent page SNMP Agent Legacy steps

Testing the SNMP Agent

Now that you have the SNMP agent enabled with an account associated with it, it's time to test it to make sure it is working. To do this, use the qs-util commands for doing an SNMP walk, for example:

qs-util snmpwalkvolumes snmpuser snmppass
qs-util snmpwalkalerts snmpuser snmppass
qs-util snmpwalkall snmpuser snmppass

Alternatively you can run a snmpwalk like so:

snmpwalk -v 3 -u snmpuser -a MD5 -A snmppass -x DES -X "snmppass" -l authPriv localhost QUANTASTOR-SYS-STATS::storageVolume

Be sure to replace snmpuser and snmppass with the user account you setup. If you're not able to get any data from the snmpwalk commands, try running a simple qs command to verify that the credentials are correct for the account like so:

qs alert-list server=localhost,snmpuser,snmppass

If that doesn't work then either the quantastor service is not running (service quantastor start) or the user account username or password isn't correct.

Configuring SNMP Agent Trap Settings

The alerts within QuantaStor have a severity of error, warning or informational and via the /etc/qs_snmptrapd.conf configuration file you can turn off these categories of alerts to fit your needs. In general you should never ignore error messages but it may be handy to disable informational alerts in some cases. Here's the default contents of the /etc/qs_snmptrapd.conf file. Note that if you delete it, the SNMP agent will automatically re-create it for you with the defaults:

poll-interval=120
ignore-error-alerts=false
ignore-warn-alerts=false
ignore-info-alerts=false

If you make any changes to this file, be sure to restart the agent like so.

qs-util snmprestart

Testing SNMP Trap Settings

By default the SNMP agent only pushes out traps every 120 seconds so you will have to wait awhile for the trap to be generated after you raise a test alert. QuantaStor only raises traps for Alert objects, so anything that you see in the Alert status bar in the web interface or see in 'qs alert-list' will be sent out as traps. Traps are only sent a single time and the agent keeps track of what alerts have been sent by writing the alert UUIDs to '/var/log/qs_snmpraisedtraps.dat'. If you delete that file then all the alerts will be raised again after the agent restarts. To generate a test alert which will be converted into an SNMP trap use this command:

qs alert-raise --title="Test" --message="snmp test message" --alert-severity=warning --server=localhost,admin,password

After you create the test alert you can then look in the log to see if it has been raised:

qs-showlog -snmp

An easier way to do that is to leave the log open with a 'tail -f /var/log/qs/qs_snmpagent.log' then hit Ctrl-C to stop monitoring the log once you see the trap generated. By default the /etc/snmp/snmpd.conf file is configure to only raise traps to the local host. To raise traps outside of the local host you'll need to add additional lines to the snmpd.conf file like this:

trap2sink 127.0.0.1 public
trap2sink 192.168.10.123 public
trap2sink 10.10.50.134 public