root/src/modules/postgres.xml

Revision d5ce396d309665655777db8daf14dc5ee1508e87, 2.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

postgres docs

  • Property mode set to 100644
Line 
1 <module>
2   <name>postgres</name>
3   <description><para>The postgres module allows queries to be performaed against targets as checks.  The results of the query are used as metrics.</para>
4   </description>
5   <loader>C</loader>
6   <image>postgres.so</image>
7   <moduleconfig />
8   <checkconfig>
9     <parameter name="dsn"
10                required="required"
11                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>
12     <parameter name="sql"
13                required="required"
14                allowed=".+">The query that will be executed.</parameter>
15   </checkconfig>
16   <examples>
17     <example>
18       <title>Tracking PostgreSQL database sizes.</title>
19       <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>
20       <programlisting><![CDATA[
21       <noit>
22         <modules>
23           <module image="postgres" name="postgres"/>
24         </modules>
25         <checks>
26           <databases>
27             <postgres  module="postgres" period="300000">
28               <config>
29                 <dsn>host=%[target] dbname=%[name] user=noit password=noit</dsn>
30                 <sql>select datname, pg_database_size(datname) as size, xact_commit, xact_rollback from pg_stat_database</sql>
31               </config>
32               <check uuid="8c5ca46c-77d7-11dd-ab5b-53bc659517d6" target="10.225.209.35"/>
33               <check uuid="90b8aea2-77d7-11dd-8447-0f381e6a48eb" target="10.225.209.56"/>
34             </postgres>
35           </databases>
36         </checks>
37       </noit>
38     ]]></programlisting>
39     </example>
40     <example>
41       <title>Checking labs.omniti.com.</title>
42       <para>The following checks the DNS server residing at 66.225.209.4 for the A record of labs.omniti.com.</para>
43       <programlisting><![CDATA[
44       <noit>
45         <modules>
46           <module image="dns" name="dns"/>
47         </modules>
48         <checks>
49           <ns1 module="dns" target="66.225.209.4">
50             <check uuid="3cddb2a8-76ff-11dd-83c8-f75cb8b93bd9" name="labs.omniti.com"/>
51           </ssh>
52         </checks>
53       </noit>
54     ]]></programlisting>
55     </example>
56   </examples>
57 </module>
Note: See TracBrowser for help on using the browser.