QStar SNMP installation, configuration and testing Change History Date Author Comments February 19, 2014 Slava Initial version March 1, 2014 Slava Update April 8, 2014 Vladas Trap destination configuration in Windows April 9,2014 Vladas MIB location change Contents QStar SNMP installation, configuration and testing... 1 Introduction... 1 Install and configure Windows SNMP service... 2 Install QStar ASM SNMP (Windows)... 4 QStar ASM SNMP testing... 5 Test SNMP functions in ireasoning MIB Browser... 5 Test SNMP TRAP processing... 11 Test SNMP functions using remote Linux commands... 13 Test environment... 14 Test SNMP GET... 14 Test SNMP TABLE... 14 Test SNMP SET... 14 Test SNMP TRAP... 15 Disable QStar SNMP (Windows)... 15 Configure Net-SNMP... 15 Configure snmpd for execution on Ubuntu... 15 Configure Net-SNMP snmpd for execution on RedHat or CentOS... 16 Appendixes... 17 Manual check of QStar SNMP agent extension configuration on Windows... 17 Starting and Stopping SNMP support processes on Linux... 18 qstarsnmpsubagent run options... 18 Introduction This document describes installation, configuration and test procedures related to QStar SNMP support. The QStar SNMP supports SNMP protocol version 2c.
Since the QStar SNMP supports SNMP protocol version 2c, so for all command line utilities you should specify option -v 2c. Install and configure Windows SNMP service Windows Feature SNMP Service should be installed. Microsoft how to instructions are available at the URL : http://technet.microsoft.com/en-us/library/cc738071(v=ws.10).aspx Check this in Administrative Tools -> Server Manager -> Features: Please configure Windows SNMP service in Administrative Tools -> Configuration -> Services:
The properties tab Security contains list of communities and list of permitted hosts: Communities are like passwords to access the SNMP with specified rights (READ ONLY or READ-WRITE). If you do not see the tab Security, please reboot the computer and return to service properties. The properties tab Traps contains list of external hosts that will receive SNMP traps:
If you do not see the tab Traps, please reboot the computer and return to service properties. Alternatively, the Windows command evntcmd can be used to configure trap destinations. For that create file with Trap destination (for example trap.txt). The content of the file trap.txt shall contain line like: #pragma ADD_TRAP_DEST public 192.168.1.111 Then execute command: evntcmd trap.txt For more information please refer to this site: http://technet.microsoft.com/en-us/library/ff963094.aspx Install QStar ASM SNMP (Windows) QStar SNMP agent should be selected during QStar ASM installation (QStar_6.0.*.exe):
QStar ASM SNMP testing Test SNMP functions in ireasoning MIB Browser ireasoning MIB Browser Free Personal Edition can be downloaded as setup.exe (Windows) file from this URL: http://www.ireasoning.com/downloadmibbrowserfree.php Installation is very simple. Start graphic browser by executing bin\browser.bat or for Windows setup.exe Connect to SNMP service on node Nadine :
Load QStar asm.mib : The asm.bin file is located in C:\QStar\snmp directory. File->Load MIBs. Expand the MIB tree, find QStar ASM nodes:
Test SNMP GET (and Get Next) command: Scalar values can be retrieved by double clicking their names in MIB tree, or one by one by pressing Go button in top right windows corner (when Get Next is selected):
SNMP tables cat be opened as follows:
Test SNMP SET command (mount and unmount QStar ASM Integral Volume set): Place cursor into column status of the row udf_sv, press the button SNMP SET:
Type the value (mount point) U:, press Ok: The volume udf_sv is now mounted as U:
Do SNMP SET with empty value to unmount: Test SNMP TRAP processing Enable SNMP traps in QStar:
Open trap receiver in ireasoning window: Simulate a trap (from inside of QStar), using the set of commands in the batch C:\QStar60\bin\do_trap.bat : These CLI commands cause trap to be sent because UDF set is mounted with clean cache and media is exported. The dir U: command caused to read directory from media which is not in the library. That generates error message (and SNMP trap).
vlcmd.exe umountiv udf_sv 2> nul vlcmd.exe mountiv -n udf_sv U: echo. vlcmd.exe export jb_sdisk 10 start cmd /C dir U: vlcmd.exe import -S+ jb_sdisk 10 vlcmd.exe umountiv udf_sv We got the trap: Easier way to simulate the trap is to invoke the command: qscmd qslog -ee -p VL -m "Test Message" Test SNMP functions using remote Linux commands Described on example of usage from the Ubuntu machine SUSAN. Please make sure that following packages are installed (apt-get install): snmpd, libsnmp15, snmp, libsnmp-base.
Please make sure that the file SNMPv2-SMI is presented in /usr/share/mibs/netsnmp/ (can be downloaded here http://net-snmp.sourceforge.net/docs/mibs/snmpv2-smi.txt) Please make sure that the file QSTAR-ASM-MIB is presented in /usr/share/mibs/netsnmp/ (can be copied from cvs60\snmp\lib\asm.mib) Test environment Assume that 172.18.1.105 is IP address of Windows machine NADINE (please make sure that Windows SNMP, QStar Server and QStar SNMP Agent are configured and running there). Test SNMP GET /usr/bin/snmpget -v 2c -c public 172.18.1.105 QSTAR-ASM-MIB::qVersion QSTAR-ASM-MIB::qVersion = STRING: "Version 6.0.1, build 3892" /usr/bin/snmpget -v 2c -c public 172.18.1.105 QSTAR-ASM-MIB::qVlServerStatus QSTAR-ASM-MIB::qVlServerStatus = STRING: "VL server is running" Test SNMP TABLE /usr/bin/snmptable -v 2c -c public -CB 172.18.1.105 QSTAR-ASM-MIB::qVolumesTable SNMP table: QSTAR-ASM-MIB::qVolumesTable qssetindex qssetname qssetstatus qssettype qssetcapacity 1 "gfs_ivs" "ready" "gfs" "total=0 kb" 2 "ltfs_sp" "ready" "vskin" "total=18874368 kb" 3 "nom" "ready" "nom" "total=0 kb" 4 "osmcluster" "ready" "osm" "total=0 kb" 5 "s3_ivs" "ready" "s3" "total=0 kb" 6 "sdf_stape" "ready" "sdf" "total=102400 kb" 7 "tdo" "ready" "tdo" "total=102400 kb" 8 "udf_sv" "ready" "udf" "total=10240000 kb" 9 "yoda" "ready" "tdo" "total=102400 kb" Test SNMP SET /usr/bin/snmpset -v 2c -c private 172.18.1.105 QSTAR-ASM-MIB::qsSetStatus.8 s "U:" /usr/bin/snmpget -v 2c -c public 172.18.1.105 QSTAR-ASM-MIB::qsSetStatus.8 QSTAR-ASM-MIB::qsSetStatus.8 = STRING: "mounted as U:" /usr/bin/snmpset -v 2c -c private 172.18.1.105 QSTAR-ASM-MIB::qsSetStatus.8 s "" /usr/bin/snmpget -v 2c -c public 172.18.1.105 QSTAR-ASM-MIB::qsSetStatus.8 QSTAR-ASM-MIB::qsSetStatus.8 = STRING: "ready"
Test SNMP TRAP Please run : /usr/sbin/snmptrapd -f -Le --disableauthorization Please make sure that on Windows machine in SNMP service settings, Trap page, IP address of Ubuntu machine (172.18.1.136) is specified in Trap destinations list. Please on Windows the batch C:\QStar60\bin\do_trap.bat that raises the trap condition. In couple of seconds you should see following trap text in Linux snmptrapd output: 2014-02-19 00:06:13 172.18.1.105(via UDP: [172.18.1.105]:52537->[172.18.1.136]) TRAP, SNMP v1, community public QSTAR-ASM-MIB::qNotif Enterprise Specific Trap (1) Uptime: 1:34:22.65 QSTAR-ASM-MIB::qNotif = STRING: "INFO VL-UDF: set udf_sv, single volume, offline udf_sv_0_1:under the table: Please vlimport medium." Disable QStar SNMP (Windows) To disable QStar SNMP Agent, please remove in Windows registry a reference to qstarsnmpagent from the list of Extension Agents: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents] remove a string value "qstarsnmpagent". After that Windows SNMP service should be restarted (stopped and then started). Configure Net-SNMP Configure snmpd for execution on Ubuntu Please make sure that following packages are installed (apt-get install): snmpd, libsnmp15, libsnmp-base. Please make sure that the file SNMPv2-SMI is present in /usr/share/mibs/netsnmp/ (can be downloaded here http://net-snmp.sourceforge.net/docs/mibs/snmpv2-smi.txt) Please make sure that the file QSTAR-ASM-MIB is present in /usr/share/mibs/netsnmp/ (can be copied from cvs60\snmp\lib\asm.mib) Configuration file /etc/snmp/snmp.conf should contain the line mibs QSTAR-ASM-MIB Changes in configuration file /etc/snmp/snmpd.conf : # AGENT BEHAVIOUR # Listen for connections from the local system only #agentaddress udp:127.0.0.1:161 # Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentaddress udp:161,udp6:[::1]:161 # ACCESS CONTROL #view systemonly included.1.3.6.1.2.1.1 #view systemonly included.1.3.6.1.2.1.25.1 view all included.1 80 # system + hrsystem groups only #rocommunity public localhost #rocommunity public default rocommunity public rwcommunity private com2sec readonly default com2sec readwrite default -V systemonly public private # Full access from the local host # Default access to basic system info # ACTIVE MONITORING #trapsink localhost public # send SNMPv2c traps trap2sink localhost public trap2sink 172.18.1.105 public # 172.18.1.105 is Nadine # AgentX Sub-agents # Run as an AgentX master agent master agentx # Listen for network connections (from localhost) # rather than the default named socket /var/agentx/master agentxsocket tcp:localhost:705 After configuration changes snmpd daemon should be restarted by /etc/init.d/snmpd restart Configure Net-SNMP snmpd for execution on RedHat or CentOS Configuration file /etc/snmp/snmp.conf (you should create this file, if absent) should contain the line: mibs QSTAR-ASM-MIB Changes in configuration file /etc/snmp/snmpd.conf : ############################################################################### # Access Control ############################################################################### # sec.name source community #com2sec notconfiguser default public rocommunity public rwcommunity private com2sec readonly default public com2sec readwrite default private # name incl/excl subtree mask(optional) #view systemview included.1.3.6.1.2.1.1 #view systemview included.1.3.6.1.2.1.25.1.1 view all included.1 80 ############################################################################### # # ACTIVE MONITORING # # send SNMPv2c traps trap2sink localhost public trap2sink 172.18.1.105 public # 172.18.1.105 is Nadine
# # AgentX Sub-agents # # Run as an AgentX master agent master agentx # Listen for network connections (from localhost) # rather than the default named socket /var/agentx/master agentxsocket tcp:localhost:705 Some configuration info was obtained from the URL : http://www.net-snmp.org/wiki/index.php/tut:writing_a_subagent#beginner_tips After configuration changes snmpd daemon should be restarted using command: service snmpd restart or /etc/rc.d/init.d/snmpd restart Appendixes Manual check of QStar SNMP agent extension configuration on Windows Compile v5x_ws\lib_snmp\lib_snmp.vcxproj (snmp\lib\*), resulting qstarsnmpagent.dll should be located in working bin\ directory. Please specify in Windows registry a reference to qstarsnmpagent in the list of Extension Agents:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents] "qstarsnmpagent"="software\\qstar Technologies, Inc.\\qstarSNMPAgent\\CurrentVersion" Please specify in Windows registry path to QStar SNMP Agent DLL: [HKEY_LOCAL_MACHINE\SOFTWARE\QStar Technologies, Inc.\qstarSNMPAgent\CurrentVersion] "Pathname"="C:\\QStar\\bin\\qstarSNMPAgent.dll" After agent installation Windows SNMP service should be restarted (stopped and then started): Starting and Stopping SNMP support processes on Linux SNMP management is a system wide operation and QStar QSM provides only SNMP subagent which can t operate by itself. The system administrator is responsible for starting and restarting SNMPD daemon using his own judgment and system requirements. QStar ASM start scripts will not stop or start QStar ASM SNMP subagent because SNMP services work independently of QStar and provide possibility to check QStar ASM status independently. The QStar SNMP subagent can be started manually using script in install directory. The script qsnmp_rc allows to start, stop and restart QStar ASM SNMP subagent. If needed that script may be added to the other scripts as scripts. qstarsnmpsubagent run options
Normally qstarsnmpsubagent should be executed without any options. It is running as daemon. For debugging purposes it can be started as./qstarsnmpsubagent -D qstar_handler -f -Lo -x tcp:localhost:705 For specific debug of trap handling it can be started as./qstarsnmpsubagent -D qstarsnmpsubagent -f -Lo -x tcp:localhost:705 Detailed instruction on all options can be obtained by./qstarsnmpsubagent h