root/src/modules/snmp.xml

Revision e3305dbe3e16ece53b7c3702e58c4b3885c1f789, 5.3 kB (checked in by Philip Maddox <pmaddox@circonus.com>, 7 months ago)

Add Ability To Query SNMP OIDs Individually

Added a control to the SNMP check to allow for querying all of
the OIDs for a check separately. This fixes the issue where some
SNMP servers are not configured to handle bulk OID requests, as
well as the SNMP v1 issue where sending a single bad OID can
invalidate the entire request.

  • Property mode set to 100644
Line 
1 <module>
2   <name>snmp</name>
3   <description><para>The snmp module provides SNMP polling support for reconnoiter.</para></description>
4   <loader>C</loader>
5   <image>snmp.so</image>
6   <moduleconfig />
7   <checkconfig>
8     <parameter name="community"
9                required="optional"
10                default="public"
11                allowed=".+">The SNMP community string providing read access.</parameter>
12     <parameter name="port"
13                required="optional"
14                default="161"
15                allowed="\d+">The UDP port to which SNMP queries will be sent.</parameter>
16     <parameter name="version"
17                required="optional"
18                default="2c"
19                allowed="(1|2c|3)">The SNMP version used for queries.</parameter>
20     <parameter name="oid_.+"
21                required="optional"
22                allowed=".+">Defines a metric to query.  Key oid_foo will establish a metric called foo.  The value of the parameter should be an OID either in decimal notation or MIB name.</parameter>
23     <parameter name="type_.+"
24                required="optional"
25                allowed=".+">Defines a coercion for a metric type.  The name of the metric must identically match one of the oid_(.+) patterns. The value can be either one of the single letter codes in the metric_type_t enum or the following string variants: guess, int32, uint32, int64, uint64, double, string.</parameter>
26     <parameter name="separate_queries"
27                required="optional"
28                default="false"
29                allowed="^(?:true|false|on|off)$">Whether or not to query each OID separately.</parameter>
30   </checkconfig>
31   <examples>
32     <example>
33       <title>Simple snmp polling of two switchports</title>
34       <para>The following example configures SNMP checks against switchport 1 and 2
35       on the switch with the IP address 10.80.116.3.</para>
36       <programlisting><![CDATA[
37       <noit>
38         <modules>
39           <module image="snmp" name="snmp"/>
40         </modules>
41         <checks>
42           <switch target="10.80.116.3" module="snmp">
43             <config>
44               <community>SeKr3t</community>
45               <oid_description>IF-MIB::ifName.%[name]</oid_description>
46               <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
47               <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
48               <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
49               <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
50               <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
51               <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
52               <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
53               <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
54               <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
55               <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
56               <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
57               <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
58               <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
59               <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
60             </config>
61             <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
62             <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
63           </switch>
64         </checks>
65       </noit>
66     ]]></programlisting>
67     </example>
68     <example>
69       <title>Example using config inheritance to show reuse</title>
70       <para>Accomplising the same goal, but by using reuse:</para>
71
72       <programlisting><![CDATA[
73       <noit>
74         <modules>
75           <module image="snmp" name="snmp"/>
76         </modules>
77         <checks>
78           <switch target="10.80.116.3" module="snmp">
79             <config inherit="SwitchPortX"/>
80               <community>SeKr3t</community>
81             </config>
82             <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
83             <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
84           </switch>
85         </checks>
86         <config_templates>
87           <config id="SwitchPortX">
88             <oid_description>IF-MIB::ifName.%[name]</oid_description>
89             <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
90             <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
91             <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
92             <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
93             <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
94             <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
95             <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
96             <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
97             <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
98             <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
99             <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
100             <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
101             <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
102             <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
103           </config>
104         </config_templates>
105       </noit>
106     ]]></programlisting>
107     </example>
108   </examples>
109 </module>
Note: See TracBrowser for help on using the browser.