[Reconnoiter-devel] [reconnoiter commit] r422 - docs/config/modules trunk/src/modules-lua

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Sun Sep 7 17:38:44 EDT 2008


Author: jesus
Date: 2008-09-07 17:38:44 -0400 (Sun, 07 Sep 2008)
New Revision: 422

Modified:
   docs/config/modules/noit.module.smtp.xml
   docs/config/modules/noit.module.varnish.xml
   trunk/src/modules-lua/Makefile.in
   trunk/src/modules-lua/extract_xml.lua
Log:
oops, extract_xml.lua produces just the meta XML, need to docbook it, refs #21

Modified: docs/config/modules/noit.module.smtp.xml
===================================================================
--- docs/config/modules/noit.module.smtp.xml	2008-09-07 21:22:50 UTC (rev 421)
+++ docs/config/modules/noit.module.smtp.xml	2008-09-07 21:38:44 UTC (rev 422)
@@ -1,43 +1,181 @@
-<module>
-  <name>smtp</name>
-  <description><para>Send an email via an SMTP server.</para></description>
-  <loader>lua</loader>
-  <object>noit.module.smtp</object>
-  <moduleconfig />
-  <checkconfig>
-    <parameter name="port" required="optional" default="25"
-               allowed="\d+">Specifies the TCP port to connect to.</parameter>
-    <parameter name="ehlo" required="optional" default="noit.local"
-               allowed="\d+">Specifies the EHLO parameter.</parameter>
-    <parameter name="from" required="optional" default=""
-               allowed="\d+">Specifies the envelope sender.</parameter>
-    <parameter name="to" required="required"
-               allowed="\d+">Specifies the envelope recipient.</parameter>
-    <parameter name="payload" required="optional" default="Subject: Testing"
-               allowed="\d+">Specifies the payload sent (on the wire). CR LF DOT CR LF is appended automatically.</parameter>
-  </checkconfig>
-  <examples>
-    <example>
-      <title>Send an email to test SMTP service.</title>
-      <para>The following example sends an email via 10.80.117.6 from test at omniti.com to devnull at omniti.com</para>
-      <programlisting><![CDATA[
-      <noit>
-        <modules>
-          <loader image="lua" name="lua">
-            <config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config>
-          </loader>
-          <module loader="lua" name="smtp" object="noit.module.smtp"/>
-        </modules>
-        <checks>
-          <check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="smtp" target="10.80.117.6">
-            <config>
-              <from>test at omniti.com</from>
-              <to>devnull at omniti.com</to>
-            </config>
-          </check>
-        </checks>
-      </noit>
-      ]]></programlisting>
-    </example>
-  </examples>
-</module>
+<?xml version="1.0"?>
+<section>
+  <title>smtp</title>
+  <para>Send an email via an SMTP server.</para>
+  <variablelist>
+    <varlistentry>
+      <term>loader</term>
+      <listitem>
+        <para>lua</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>object</term>
+      <listitem>
+        <para>noit.module.smtp</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+  <section>
+    <title>Module Configuration</title>
+  </section>
+  <section>
+    <title>Check Configuration</title>
+    <variablelist>
+      <varlistentry>
+        <term>port</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>optional</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>default</term>
+              <listitem>
+                <para>25</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the TCP port to connect to.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    <variablelist>
+      <varlistentry>
+        <term>ehlo</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>optional</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>default</term>
+              <listitem>
+                <para>noit.local</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the EHLO parameter.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    <variablelist>
+      <varlistentry>
+        <term>from</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>optional</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>default</term>
+              <listitem>
+                <para/>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the envelope sender.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    <variablelist>
+      <varlistentry>
+        <term>to</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>required</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the envelope recipient.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    <variablelist>
+      <varlistentry>
+        <term>payload</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>optional</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>default</term>
+              <listitem>
+                <para>Subject: Testing</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the payload sent (on the wire). CR LF DOT CR LF is appended automatically.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </section>
+  <example>
+    <title>Send an email to test SMTP service.</title>
+    <para>The following example sends an email via 10.80.117.6 from test at omniti.com to devnull at omniti.com</para>
+    <programlisting>
+      &lt;noit&gt;
+        &lt;modules&gt;
+          &lt;loader image="lua" name="lua"&gt;
+            &lt;config&gt;&lt;directory&gt;/opt/reconnoiter/libexec/modules-lua/?.lua&lt;/directory&gt;&lt;/config&gt;
+          &lt;/loader&gt;
+          &lt;module loader="lua" name="smtp" object="noit.module.smtp"/&gt;
+        &lt;/modules&gt;
+        &lt;checks&gt;
+          &lt;check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="smtp" target="10.80.117.6"&gt;
+            &lt;config&gt;
+              &lt;from&gt;test at omniti.com&lt;/from&gt;
+              &lt;to&gt;devnull at omniti.com&lt;/to&gt;
+            &lt;/config&gt;
+          &lt;/check&gt;
+        &lt;/checks&gt;
+      &lt;/noit&gt;
+      </programlisting>
+  </example>
+</section>

Modified: docs/config/modules/noit.module.varnish.xml
===================================================================
--- docs/config/modules/noit.module.varnish.xml	2008-09-07 21:22:50 UTC (rev 421)
+++ docs/config/modules/noit.module.varnish.xml	2008-09-07 21:38:44 UTC (rev 422)
@@ -1,31 +1,71 @@
-<module>
-  <name>varnish</name>
-  <description><para>Monitor maagement metrics of a Varnish instance.</para></description>
-  <loader>lua</loader>
-  <object>noit.module.varnish</object>
-  <moduleconfig />
-  <checkconfig>
-    <parameter name="port" required="optional" default="8081"
-               allowed="\d+">Specifies the port on which the management interface can be reached.</parameter>
-  </checkconfig>
-  <examples>
-    <example>
-      <title>Monitor two varnish instances with management on port 8081</title>
-      <para>The following example pulls are metrics available from Varnish running on 10.1.2.3 and 10.1.2.4</para>
-      <programlisting><![CDATA[
-      <noit>
-        <modules>
-          <loader image="lua" name="lua">
-            <config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config>
-          </loader>
-          <module loader="lua" name="varnish" object="noit.module.varnish"/>
-        </modules>
-        <checks>
-          <check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="varnish" target="10.1.2.3" />
-          <check uuid="324c2234-7c7a-11dd-8585-cbb783f8267f" module="varnish" target="10.1.2.4" />
-        </checks>
-      </noit>
-      ]]></programlisting>
-    </example>
-  </examples>
-</module>
+<?xml version="1.0"?>
+<section>
+  <title>varnish</title>
+  <para>Monitor maagement metrics of a Varnish instance.</para>
+  <variablelist>
+    <varlistentry>
+      <term>loader</term>
+      <listitem>
+        <para>lua</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>object</term>
+      <listitem>
+        <para>noit.module.varnish</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+  <section>
+    <title>Module Configuration</title>
+  </section>
+  <section>
+    <title>Check Configuration</title>
+    <variablelist>
+      <varlistentry>
+        <term>port</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>optional</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>default</term>
+              <listitem>
+                <para>8081</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>\d+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>Specifies the port on which the management interface can be reached.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </section>
+  <example>
+    <title>Monitor two varnish instances with management on port 8081</title>
+    <para>The following example pulls are metrics available from Varnish running on 10.1.2.3 and 10.1.2.4</para>
+    <programlisting>
+      &lt;noit&gt;
+        &lt;modules&gt;
+          &lt;loader image="lua" name="lua"&gt;
+            &lt;config&gt;&lt;directory&gt;/opt/reconnoiter/libexec/modules-lua/?.lua&lt;/directory&gt;&lt;/config&gt;
+          &lt;/loader&gt;
+          &lt;module loader="lua" name="varnish" object="noit.module.varnish"/&gt;
+        &lt;/modules&gt;
+        &lt;checks&gt;
+          &lt;check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="varnish" target="10.1.2.3" /&gt;
+          &lt;check uuid="324c2234-7c7a-11dd-8585-cbb783f8267f" module="varnish" target="10.1.2.4" /&gt;
+        &lt;/checks&gt;
+      &lt;/noit&gt;
+      </programlisting>
+  </example>
+</section>

Modified: trunk/src/modules-lua/Makefile.in
===================================================================
--- trunk/src/modules-lua/Makefile.in	2008-09-07 21:22:50 UTC (rev 421)
+++ trunk/src/modules-lua/Makefile.in	2008-09-07 21:38:44 UTC (rev 422)
@@ -23,6 +23,8 @@
 sysconfdir=@sysconfdir@
 srcdir=@srcdir@
 top_srcdir=@top_srcdir@
+XSLTPROC=@XSLTPROC@
+XMLLINT=@XMLLINT@
 MODULES_DIR=@MODULES_DIR@
 
 LUA=noit/timeval.lua \
@@ -39,5 +41,10 @@
 
 alldocs:	../modules/docs
 	for lua in $(LUA); do \
-		$(top_srcdir)/src/lua/src/lua extract_xml.lua $$lua ../modules/docs ; \
+		$(top_srcdir)/src/lua/src/lua extract_xml.lua $$lua tmp.xml ; \
+		test -f tmp.xml && \
+			$(XSLTPROC) ../modules/module.xsl tmp.xml | \
+			$(XMLLINT) --format - > \
+			../modules/docs/`echo $$lua | sed -e 's/\.lua/.xml/; s/\//./g'` ; \
+		rm -f tmp.xml ; \
 	done

Modified: trunk/src/modules-lua/extract_xml.lua
===================================================================
--- trunk/src/modules-lua/extract_xml.lua	2008-09-07 21:22:50 UTC (rev 421)
+++ trunk/src/modules-lua/extract_xml.lua	2008-09-07 21:38:44 UTC (rev 422)
@@ -1,6 +1,6 @@
 rc = 0
 
-function extract(file, docsdir)
+function extract(file, outfile)
   local module = file:gsub('.lua$', ''):gsub('/', '.')
   local M = require(module)
   if not M or not M.onload then
@@ -9,7 +9,7 @@
   M.onload( {
     xml_description =
       function(xml)
-        local f = io.open(docsdir .. "/" .. module .. ".xml", "w+")
+        local f = io.open(outfile, "w+")
         if not f then
           rc = 2
         end
@@ -21,7 +21,7 @@
 
 
 if (#arg) ~= 2 then
-  print(string.format("%s <module> <docs directory>\n", (arg[0])))
+  print(string.format("%s <module> <outputfile>\n", (arg[0])))
   os.exit(1)
 end
 



More information about the Reconnoiter-devel mailing list