[Reconnoiter-devel] [reconnoiter commit] r399 - in trunk: . src/modules

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Thu Aug 28 23:28:37 EDT 2008


Author: jesus
Date: 2008-08-28 23:28:37 -0400 (Thu, 28 Aug 2008)
New Revision: 399

Added:
   trunk/src/modules/module.xsl
   trunk/src/modules/snmp.xml
Modified:
   trunk/configure.in
   trunk/src/modules/
   trunk/src/modules/Makefile.in
Log:
integrate the framework for docs... snmp docs

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2008-08-29 03:18:15 UTC (rev 398)
+++ trunk/configure.in	2008-08-29 03:28:37 UTC (rev 399)
@@ -21,6 +21,8 @@
 AC_PROG_LN_S
 AC_PATH_PROG(AR, ar)
 AC_PATH_PROGS(PERL, perl)
+AC_PATH_PROGS(XSLTPROC, xsltproc)
+AC_PATH_PROGS(XMLLINT, xmllint)
 AC_SUBST(PERL)
 
 if test "x$CC" = "xgcc" ; then


Property changes on: trunk/src/modules
___________________________________________________________________
Name: svn:externals
   + docs https://labs.omniti.com/reconnoiter/docs/config/modules


Modified: trunk/src/modules/Makefile.in
===================================================================
--- trunk/src/modules/Makefile.in	2008-08-29 03:18:15 UTC (rev 398)
+++ trunk/src/modules/Makefile.in	2008-08-29 03:28:37 UTC (rev 399)
@@ -15,6 +15,8 @@
 PGLIBS=@PGLIBS@
 INSTALL=@INSTALL@
 MODULES_DIR=@MODULES_DIR@
+XSLTPROC=@XSLTPROC@
+XMLLINT=@XMLLINT@
 
 top_srcdir=@top_srcdir@
 
@@ -80,6 +82,11 @@
 	@$(CC) $(CPPFLAGS) $(SHCFLAGS) -c $< -o $@
 	@echo "- compiling $<"
 
+alldocs:
+	for c in *.xml ; do \
+		$(XSLTPROC) module.xsl $$c | $(XMLLINT) --format - > docs/$$c ; \
+	done
+	
 install:	all
 	$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(MODULES_DIR)
 	for mod in $(MODULES); do \

Added: trunk/src/modules/module.xsl
===================================================================
--- trunk/src/modules/module.xsl	                        (rev 0)
+++ trunk/src/modules/module.xsl	2008-08-29 03:28:37 UTC (rev 399)
@@ -0,0 +1,61 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="parameter" name="configparams">
+  <variablelist>
+    <varlistentry><term><xsl:value-of select="@name"/></term>
+      <listitem>
+        <variablelist>
+          <varlistentry><term>required</term><listitem><para><xsl:value-of select="@required"/></para></listitem></varlistentry>
+          <xsl:if test="@default">
+          <varlistentry><term>default</term><listitem><para>
+            <xsl:value-of select="@default"/>
+            </para></listitem></varlistentry>
+          </xsl:if>
+          <varlistentry><term>allowed</term><listitem><para><xsl:value-of select="@allowed"/></para></listitem></varlistentry>
+        </variablelist>
+      <para>
+        <xsl:value-of select="." />
+      </para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</xsl:template>
+
+<xsl:template match="/">
+  <section>
+    <title><xsl:value-of select="module/name"/></title>
+    <para>
+      <xsl:value-of select="module/description"/>
+    </para>
+
+    <variablelist>
+      <varlistentry><term>loader</term><listitem><para><xsl:value-of select="module/loader"/></para></listitem></varlistentry>
+      <xsl:if test="module/image">
+      <varlistentry><term>image</term><listitem><para><xsl:value-of select="module/image"/></para></listitem></varlistentry>
+      </xsl:if>
+      <xsl:if test="module/object">
+      <varlistentry><term>object</term><listitem><para><xsl:value-of select="module/object"/></para></listitem></varlistentry>
+      </xsl:if>
+    </variablelist>
+
+  <section>
+    <title>Module Configuration</title>
+    <xsl:for-each select="module/moduleconfig/parameter">
+      <xsl:call-template name="configparams" />
+    </xsl:for-each>
+  </section>
+
+  <section>
+    <title>Check Configuration</title>
+    <xsl:for-each select="module/checkconfig/parameter">
+      <xsl:call-template name="configparams" />
+    </xsl:for-each>
+  </section>
+
+  <xsl:for-each select="module/examples/example">
+    <xsl:copy-of select="."/>
+  </xsl:for-each>
+  </section>
+</xsl:template>
+</xsl:stylesheet>

Added: trunk/src/modules/snmp.xml
===================================================================
--- trunk/src/modules/snmp.xml	                        (rev 0)
+++ trunk/src/modules/snmp.xml	2008-08-29 03:28:37 UTC (rev 399)
@@ -0,0 +1,94 @@
+<module>
+  <name>snmp</name>
+  <description>The snmp module provides SNMP polling support for reconnoiter.</description>
+  <loader>C</loader>
+  <image>snmp.so</image>
+  <moduleconfig />
+  <checkconfig>
+    <parameter name="community"
+               required="optional"
+               default="public"
+               allowed=".+">The SNMP community string providing read access.</parameter>
+    <parameter name="oid_.+"
+               required="optional"
+               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>
+  </checkconfig>
+  <examples>
+    <example>
+      <title>Simple snmp polling of two switchports</title>
+      <para>The following example configures SNMP checks against switchport 1 and 2
+      on the switch with the IP address 10.80.116.3.</para>
+      <programlisting><![CDATA[
+      <noit>
+        <modules>
+          <module image="snmp" name="snmp"/>
+        </modules>
+        <checks>
+          <switch target="10.80.116.3">
+            <config>
+              <community>SeKr3t</community>
+              <oid_description>IF-MIB::ifName.%[name]</oid_description>
+              <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
+              <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
+              <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
+              <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
+              <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
+              <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
+              <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
+              <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
+              <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
+              <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
+              <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
+              <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
+              <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
+              <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
+            </config>
+            <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
+            <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
+          </switch>
+        </checks>
+      </noit>
+    ]]></programlisting>
+    </example>
+    <example>
+      <title>Example using config inheritance to show reuse</title>
+      <para>Accomplising the same goal, but by using reuse:</para>
+
+      <programlisting><![CDATA[
+      <noit>
+        <modules>
+          <module image="snmp" name="snmp"/>
+        </modules>
+        <checks>
+          <switch target="10.80.116.3" module="snmp">
+            <config inherit="SwitchPortX"/>
+              <community>SeKr3t</community>
+            </config>
+            <check uuid="1b4e28ba-2fa1-11d2-883f-e9b761bde3fb" name="1"/>
+            <check uuid="4deb0724-ccee-4360-83bc-255e7b9d989d" name="2"/>
+          </switch>
+        </checks>
+        <config_templates>
+          <config id="SwitchPortX">
+            <oid_description>IF-MIB::ifName.%[name]</oid_description>
+            <oid_alias>IF-MIB::ifAlias.%[name]</oid_alias>
+            <oid_speed>IF-MIB::ifSpeed.%[name]</oid_speed>
+            <oid_adminstatus>IF-MIB::ifAdminStatus.%[name]</oid_adminstatus>
+            <oid_operstatus>IF-MIB::ifOperStatus.%[name]</oid_operstatus>
+            <oid_inoctets>IF-MIB::ifHCInOctets.%[name]</oid_inoctets>
+            <oid_outoctets>IF-MIB::ifHCOutOctets.%[name]</oid_outoctets>
+            <oid_inerrors>IF-MIB::ifInErrors.%[name]</oid_inerrors>
+            <oid_outerrors>IF-MIB::ifOutErrors.%[name]</oid_outerrors>
+            <oid_indiscards>IF-MIB::ifInDiscards.%[name]</oid_indiscards>
+            <oid_outdiscards>IF-MIB::ifOutDiscards.%[name]</oid_outdiscards>
+            <oid_inucastpkts>IF-MIB::ifHCInUcastPkts.%[name]</oid_inucastpkts>
+            <oid_outucastpkts>IF-MIB::ifHCOutUcastPkts.%[name]</oid_outucastpkts>
+            <oid_inbcastpkts>IF-MIB::ifHCInBroadcastPkts.%[name]</oid_inbcastpkts>
+            <oid_outbcastpkts>IF-MIB::ifHCOutBroadcastPkts.%[name]</oid_outbcastpkts>
+          </config>
+        </config_templates>
+      </noit>
+    ]]></programlisting>
+    </example>
+  </examples>
+</module>



More information about the Reconnoiter-devel mailing list