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

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Sun Aug 31 23:43:31 EDT 2008


Author: jesus
Date: 2008-08-31 23:43:31 -0400 (Sun, 31 Aug 2008)
New Revision: 408

Added:
   docs/config/modules/postgres.xml
   trunk/src/modules/postgres.xml
Log:
postgres docs

Added: docs/config/modules/postgres.xml
===================================================================
--- docs/config/modules/postgres.xml	                        (rev 0)
+++ docs/config/modules/postgres.xml	2008-09-01 03:43:31 UTC (rev 408)
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<section>
+  <title>postgres</title>
+  <para>The postgres module allows queries to be performaed against targets as checks.  The results of the query are used as metrics.</para>
+  <variablelist>
+    <varlistentry>
+      <term>loader</term>
+      <listitem>
+        <para>C</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>image</term>
+      <listitem>
+        <para>postgres.so</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+  <section>
+    <title>Module Configuration</title>
+  </section>
+  <section>
+    <title>Check Configuration</title>
+    <variablelist>
+      <varlistentry>
+        <term>dsn</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>required</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>.+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>The connect string for PostgreSQL.  The syntax of this string is documented in your PostgreSQL documentation. See Database Connection Control Functions.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    <variablelist>
+      <varlistentry>
+        <term>sql</term>
+        <listitem>
+          <variablelist>
+            <varlistentry>
+              <term>required</term>
+              <listitem>
+                <para>required</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>allowed</term>
+              <listitem>
+                <para>.+</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+          <para>The query that will be executed.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </section>
+  <example>
+    <title>Tracking PostgreSQL database sizes.</title>
+    <para>This will track the sizes of all databases on 10.225.209.35 and 10.225.209.56. We will connect to the postgres database as the user "noit" with password "noit." We only run this check every 5 minutes.</para>
+    <programlisting>
+      &lt;noit&gt;
+        &lt;modules&gt;
+          &lt;module image="postgres" name="postgres"/&gt;
+        &lt;/modules&gt;
+        &lt;checks&gt;
+          &lt;databases&gt;
+            &lt;postgres  module="postgres" period="300000"&gt;
+              &lt;config&gt;
+                &lt;dsn&gt;host=%[target] dbname=%[name] user=noit password=noit&lt;/dsn&gt;
+                &lt;sql&gt;select datname, pg_database_size(datname) as size, xact_commit, xact_rollback from pg_stat_database&lt;/sql&gt;
+              &lt;/config&gt;
+              &lt;check uuid="8c5ca46c-77d7-11dd-ab5b-53bc659517d6" target="10.225.209.35"/&gt;
+              &lt;check uuid="90b8aea2-77d7-11dd-8447-0f381e6a48eb" target="10.225.209.56"/&gt;
+            &lt;/postgres&gt;
+          &lt;/databases&gt;
+        &lt;/checks&gt;
+      &lt;/noit&gt;
+    </programlisting>
+  </example>
+  <example>
+    <title>Checking labs.omniti.com.</title>
+    <para>The following checks the DNS server residing at 66.225.209.4 for the A record of labs.omniti.com.</para>
+    <programlisting>
+      &lt;noit&gt;
+        &lt;modules&gt;
+          &lt;module image="dns" name="dns"/&gt;
+        &lt;/modules&gt;
+        &lt;checks&gt;
+          &lt;ns1 module="dns" target="66.225.209.4"&gt;
+            &lt;check uuid="3cddb2a8-76ff-11dd-83c8-f75cb8b93bd9" name="labs.omniti.com"/&gt;
+          &lt;/ssh&gt;
+        &lt;/checks&gt;
+      &lt;/noit&gt;
+    </programlisting>
+  </example>
+</section>

Added: trunk/src/modules/postgres.xml
===================================================================
--- trunk/src/modules/postgres.xml	                        (rev 0)
+++ trunk/src/modules/postgres.xml	2008-09-01 03:43:31 UTC (rev 408)
@@ -0,0 +1,57 @@
+<module>
+  <name>postgres</name>
+  <description><para>The postgres module allows queries to be performaed against targets as checks.  The results of the query are used as metrics.</para>
+  </description>
+  <loader>C</loader>
+  <image>postgres.so</image>
+  <moduleconfig />
+  <checkconfig>
+    <parameter name="dsn"
+               required="required"
+               allowed=".+">The connect string for PostgreSQL.  The syntax of this string is documented in your PostgreSQL documentation. See <ulink url="http://www.postgresql.org/docs/8.3/static/libpq-connect.html"><citetitle>Database Connection Control Functions</citetitle></ulink>.</parameter>
+    <parameter name="sql"
+               required="required"
+               allowed=".+">The query that will be executed.</parameter>
+  </checkconfig>
+  <examples>
+    <example>
+      <title>Tracking PostgreSQL database sizes.</title>
+      <para>This will track the sizes of all databases on 10.225.209.35 and 10.225.209.56. We will connect to the postgres database as the user "noit" with password "noit." We only run this check every 5 minutes.</para>
+      <programlisting><![CDATA[
+      <noit>
+        <modules>
+          <module image="postgres" name="postgres"/>
+        </modules>
+        <checks>
+          <databases>
+            <postgres  module="postgres" period="300000">
+              <config>
+                <dsn>host=%[target] dbname=%[name] user=noit password=noit</dsn>
+                <sql>select datname, pg_database_size(datname) as size, xact_commit, xact_rollback from pg_stat_database</sql>
+              </config>
+              <check uuid="8c5ca46c-77d7-11dd-ab5b-53bc659517d6" target="10.225.209.35"/>
+              <check uuid="90b8aea2-77d7-11dd-8447-0f381e6a48eb" target="10.225.209.56"/>
+            </postgres>
+          </databases>
+        </checks>
+      </noit>
+    ]]></programlisting>
+    </example>
+    <example>
+      <title>Checking labs.omniti.com.</title>
+      <para>The following checks the DNS server residing at 66.225.209.4 for the A record of labs.omniti.com.</para>
+      <programlisting><![CDATA[
+      <noit>
+        <modules>
+          <module image="dns" name="dns"/>
+        </modules>
+        <checks>
+          <ns1 module="dns" target="66.225.209.4">
+            <check uuid="3cddb2a8-76ff-11dd-83c8-f75cb8b93bd9" name="labs.omniti.com"/>
+          </ssh>
+        </checks>
+      </noit>
+    ]]></programlisting>
+    </example>
+  </examples>
+</module>



More information about the Reconnoiter-devel mailing list