root/src/modules/snmp.xml

Revision 7ae62b9ec2b5f252357a0d80446c0ad5ad6dd7fa, 5.0 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 2 years ago)

support snmp type coercion... BAD VENDORS... BAD.

  • 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="oid_.+"
17                required="optional"
18                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>
19     <parameter name="type_.+"
20                required="optional"
21                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>
22   </checkconfig>
23   <examples>
24     <example>
25       <title>Simple snmp polling of two switchports</title>
26       <para>The following example configures SNMP checks against switchport 1 and 2
27       on the switch with the IP address 10.80.116.3.</para>
28       <programlisting><![CDATA[
29       <noit>
30         <modules>
31           <module image="snmp" name="snmp"/>
32         </modules>
33         <checks>
34           <switch target="10.80.116.3" module="snmp">
35             <config>
36               <community>SeKr3t</community>
37               <oid_description>IF-MIB::ifName.%[name]</oid_description>
38               <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
39               <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
40               <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
41               <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
42               <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
43               <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
44               <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
45               <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
46               <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
47               <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
48               <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
49               <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
50               <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
51               <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
52             </config>
53             <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
54             <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
55           </switch>
56         </checks>
57       </noit>
58     ]]></programlisting>
59     </example>
60     <example>
61       <title>Example using config inheritance to show reuse</title>
62       <para>Accomplising the same goal, but by using reuse:</para>
63
64       <programlisting><![CDATA[
65       <noit>
66         <modules>
67           <module image="snmp" name="snmp"/>
68         </modules>
69         <checks>
70           <switch target="10.80.116.3" module="snmp">
71             <config inherit="SwitchPortX"/>
72               <community>SeKr3t</community>
73             </config>
74             <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
75             <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
76           </switch>
77         </checks>
78         <config_templates>
79           <config id="SwitchPortX">
80             <oid_description>IF-MIB::ifName.%[name]</oid_description>
81             <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
82             <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
83             <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
84             <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
85             <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
86             <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
87             <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
88             <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
89             <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
90             <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
91             <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
92             <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
93             <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
94             <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
95           </config>
96         </config_templates>
97       </noit>
98     ]]></programlisting>
99     </example>
100   </examples>
101 </module>
Note: See TracBrowser for help on using the browser.