| Osmius Agent SNMP | |
| Agent Name: osm_ag_SNMPGET1 | Agent Code: SNMPGET1 |
| Subject: | User manual for Osmius Agent for protocol snmp v1 y v2c |
| Date Created: 07/11/2008 | Date Reviewed: 01/12/2009 |
This is an standard agent to monitor predefined or customized variables from network devices than can answer questions based on the SNMP protocol. This agent has been tested against devices such as Servers running snmp agents under OS like Windows 2000, Windows 2003, Windows 7, Linux, HP-UX or Solaris, or network devices such as routers, printers, switches or wireless access points. The Osmius SNMPGET agent can talk to any device with SNMP v1 or SNMP v2c capabilities.
As the other Osmius agents this one has been developed using ACE C++ libraries that provides general features like superior performance, real multiplatform and robustness, so you need to install ACE properly in order to install and run this agent in case you want to compile it your self (You can forget this if you install Osmius agents using the wizard installer). More about installation here.
This agent also needs the Net-SNMP fantastic libraries Net-SNMP.
The Osmius SNMPGET1 agent offers several basic events and up to ten customizable events using configuration parameters such as the OID, to allow the user to create new events an adapt to their own network infrastructure. The basic events have been chosen by network experts. This agent also provides a general interface so the Osmius users can create customized events and associate them with any Instance within the monitoring system. Using the Osmius Web Console the users access to a MIB Navigator to load MIBS and to search for the appropriate snmp oid to create their own events.
Osmius also has an agent to receive and process SNMP Traps to redirect them into the event correlation system as they were Osmius “normal” events.
In this agent all the provided events are non-intrusive events, remote events, so they can be retrieved from the network outside of the Instance being monitored. events are build upon the versions 1 and 2 (2c) of SNMP protocol.
Here you can find a good SNMP C API programming guide.
As a general rule each Osmis agent can monitor only one Instance Type. If you are not familiar with these concepts please review the Concepts Glossary. Each Instance is defined in the configuration file (more information in agents & instances) and depending on the agent we need to provide the Instance Connection INFO.
The connection_info is the information needed by the agent to connect to a specific instance. (Take a look to the connection_info)
In the case of the Osmius SNMP agent the connection_info is formed by these parameters:
CONNECTION_INFO= [-N nodename] [-K community_name] [-P port]
Every instance in Osmius, although they don't belong to the SNMP type, can use this three parameters that will be used in user defined events leveraging the SNMP Interface.
The type defines the Instance Type to be monitored. Every Osmius instance have to be associated to a specific type as you can review here
In this case:
TYPE= SNMPGET1
| EVENT | DESCRIPTION | c | tsegundos | w | a | Extra Parameters / Observations |
|---|---|---|---|---|---|---|
| SNSYSDES | Retrieves the description of the SNMP device and also checks availability | 0 | 600 | 1 | 1 | [-Q timeout] [-V 1,2] |
| SNSYSUPT | Uptime seconds since the device is up and running | 1 | 600 | 60 | 30 | [-Q timeout] [-V 1,2] |
| SNSYSNAM | Retrieves the SNMP name | 0 | 600 | 1 | 1 | [-Q timeout] [-V 1,2] |
| SNSYSLOC | Retrieves the SNMP location | 0 | 600 | 1 | 1 | [-Q timeout] [-V 1,2] Silence mode ( -s) recommended |
| SNSYSCON | Retrieves the SNMP contact name | 0 | 600 | 1 | 1 | [-Q timeout] [-V 1,2] Silence mode ( -s) recommended |
| SNUS0001 a SNUS0009 | These are user events prepared to read the oid parameter and send it back to the Osmius process. | 0 | 600 | 1 | 1 | -O “oid” [-N nodename] [-K community_name] [-P port] [-Q timeout] [-V 1,2] |
SNSYSDES event returns the System Description associated text. The “oid ” is:
.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0
Return Values:
| VALUE | MEANING |
| -1 | Error |
| 0 | Failed to retrieve the value |
| 1 | Value correctly retrieved |
Recommended Parameters Values:
| Comparison Type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitoring Interval | 300 seconds – 1 hour –> Depending on the relative importance of the instance |
| warning threshold | 0 |
| critical threshold | 0 |
Example:
SNSYSDES = -t 300 -c 1 -w 0 -a 0 -T "Snmp system description"
Comments:
The associated SNMP text will be into the event text.
This event uses the Net-SNMP libraries.
SNSYSNAM event returns the System Name associated text. The “oid ” is:
.iso.org.dod.internet.mgmt.mib-2.system.sysName.0
Return Values:
| VALUE | MEANING |
| -1 | Error |
| 0 | Failed to retrieve the value |
| 1 | Value correctly retrieved |
Recommended Parameters Values:
| Comparison Type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitoring Interval | 300 seconds – 1 hour –> Depending on the relative importance of the instance |
| warning threshold | 0 |
| critical threshold | 0 |
Example:
SNSYSNAM = -t 300 -c 1 -w 0 -a 0 -T "Snmp system name"
Comments:
The associated SNMP text will be into the event text.
This event uses the Net-SNMP libraries
SNSYSUPT event returns the number of ticks since the system was last time started up. The “oid ” is:
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance
Return Values:
| VALUE | MEANING |
| -1 | Error |
| N | timeticks |
Recommended Parameters Values:
| Comparison Type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitoring Interval | 300 seconds – 1 hour –> Depending on the relative importance of the instance |
| warning threshold | 600 |
| critical threshold | 500 |
Example:
SNSYSUPT = -t 300 -c 1 -w 600 -a 500 -T "System uptime in timeticks"
Comments: This event uses the Net-SNMP libraries
SNSYSNAM event returns the System Location associated text. The “oid ” is:
.iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0
Return Values:
| VALUE | MEANING |
| -1 | Error |
| 0 | Failed to retrieve the value |
| 1 | Value correctly retrieved |
Recommended Parameters Values:
| Comparison Type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitoring Interval | 300 seconds – 1 hour –> Depending on the relative importance of the instance |
| warning threshold | 0 |
| critical threshold | 0 |
Example:
SNSYSLOC = -t 300 -c 1 -w 0 -a 0 -T "Snmp system Location"
Comments:
The associated SNMP text will be into the event text.
This event uses the Net-SNMP libraries
SNUS0001 event returns the texto or the numeric value in the snmp device related to tje “iod” used as a customized parameter. If the oid is numeric the return value is this number. If the oid is a string the return value is 1 if the retrieval worked properly and the string will be attached into the event text. In case of error the return value is 0.
Extra parameters:
| PARAMETER | MEANING | Mandatory |
| -O | -O “oid”- oid to recover. Try first one of these commands “snmpwalk -v1 -O f -c community target_IP” or “snmpget -v1 -c community -o oid target_IP. | Yes |
| -N | -L “nodename” - This node name overrides the one in the Instance CONNECTION_INFO and the default one (agent hostname). | No |
| -K | -K “community” - This “community name” overrides the one in the instance CONNECTION_INFO and the default one (“public”). | No |
| -P | -P “port” - This “port” overrides the one in the instance CONNECTION_INFO and the default one (161). | No |
| -Q | -Q “timeout” - timeout in seconds for the snmpget operations. Defaults to 0, no timeout. | No |
| -V | -V “version” - SNMP protocol version. Allowed values are [1, 2]. Defaults 2 (v2c). | No |
Return Values:
| VALOR | SIGNIFICADO |
| -1 | Error |
| 0 | Failed to retrieve |
| 1 | String value correctly retrieved |
| N | Numeric value correctly retrieved |
Recommended Parameters:
| Comparison Type | Inverted or Direct. Depending on the oid parameter. |
| monitoring interval | 300 segundos – 1 hora –> depends on the instance classification |
| warning threshold | 0 or N depending on the oid type |
| critical threshold | or N depending on the oid type |
Example:
SNUS0001 = -t 300 -c 1 -w 0 -a 0 -T "Snmp system description" -O ".iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0" -K secret_community -P 177 -Q 3 -V 1
Comments:
The associated SNMP text will be into the event text.
This event uses the Net-SNMP libraries
In order to compile, this agent requires a set of prerequisites, which are generic to compile any Osmius agent, you can see these prerequisites.
This agent needs also the Net-SNMP libraries and includes ( “libsnmp” in Ubuntu ) usually found here: http://net-snmp.sourceforge.net/.
From the agent directory using console or terminal.
%ACE_ROOT%\bin\mpc.pl -type gnuace osm_ag_snmp.mpc
gmake -f Makefile.Osm_Ag_Snmp_Osmius
Binaries are automatically installed in the bin directory of OSM_ROOT base directory.
The Osmius SNMP agent have the same running features of the other Osmius agents. You can check it out int he section Start and Stop Agents.
To run the SNMP agent without Osmius web console:
| osm_ag_SNMPGET1 -c osm_ag_SNMPGET1.ini -m MASTERAG -p 1950 -d [>> osm_ag_snmpget1.log]1) |
This Osmius agent, like the others Osmius agents, allows the execution in standalone mode. This option may be particularly useful when developing a new agent or to perform specific agent tests.
Basically you have to add a new value, called SNDCMD, to the Osmius agent configuration file (osm_ag_XXXXXXX.ini) as shown here.
Then you must run the agent setting the Master Agent and communications port to zero, for example:
| osm_ag_XXXXXXXX.exe -c osm_ag_XXXXXXXX.ini -m 00000000 -p 0 -d |
| Date: | 21/11/2008 y 01/12/2009 | |
|---|---|---|
| Test | Results | Comments |
| Creating an instance with all its events in silent mode | OK | N/A |
| Creating an instance with all its events with custom text | OK | N/A |
| Creating an instance with all its events but no custom text | OK | N/A |
| Declaration of 3 instances with all its events to 5 seconds and keep it running for 48 hours | OK | N/A |
| Declare 2 instances, cause a disconnect and then reconnect | OK | N/A |
| Declare 1 instance and test each event | OK | N/A |
| Elimination of general parameter and check unbootable | OK | Delete RECONN |
| Elimination of instance CONN_INFO and check unbootable | OK | SNMPGET1 Instances don't need connection info |