cvs: peardoc /en/package/system/system-procwatch intro.xml

From: Date: Mon, 02 Feb 2004 19:31:40 +0000
Subject: cvs: peardoc /en/package/system/system-procwatch intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-2352@lists.php.net to get a copy of this message
mike Mon Feb 2 14:31:40 2004 EDT Modified files: /peardoc/en/package/system/system-procwatch intro.xml Log: * typos * added example for configuration by array http://cvs.php.net/diff.php/peardoc/en/package/system/system-procwatch/intro.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/system/system-procwatch/intro.xml diff -u peardoc/en/package/system/system-procwatch/intro.xml:1.1 peardoc/en/package/system/system-procwatch/intro.xml:1.2 --- peardoc/en/package/system/system-procwatch/intro.xml:1.1 Fri Jan 30 12:01:16 2004 +++ peardoc/en/package/system/system-procwatch/intro.xml Mon Feb 2 14:31:40 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.system.system-procwatch.intro"> <refnamediv> <refname>Intro</refname> @@ -76,7 +76,7 @@ <programlisting> <![CDATA[ USAGE: -$ procwatch -c <file> [-d <dtd>] [-v] +$ procwatch-lint -c <file> [-d <dtd>] [-v] OPTIONS: -c | --conf= path to XML configuration file @@ -123,20 +123,20 @@ </para> <refsect3 id="package.system.system-procwatch.intro.configuration.xml.root"> - <title>The Root Element</title> + <title>Ruleset: The Root Element</title> <para> - The root element of aon XML configuration file is the + The root element of an XML configuration file is the <emphasis>procwatch</emphasis> element. It has one implicit attribute, - the <emphasis>version</emphasis> attribute set to &quot;1.0&quot;. + the <emphasis>version</emphasis> attribute, set to &quot;1.0&quot;. </para> <para> - The <emphasis>procwatch</emphasis> element symbolizes our ruleset, and the childs of the - root are our rules. + The <emphasis>procwatch</emphasis> element symbolizes our ruleset, + and the childs of the root are our rules. </para> </refsect3> <refsect3 id="package.system.system-procwatch.intro.configuration.xml.watch"> - <title>The Childs of the Root</title> + <title>Rules: The Childs of the Root</title> <para> The direct descendants of the root element <emphasis>procwatch</emphasis>, are the <emphasis>watch</emphasis> elements, which can occur 1 time or @@ -181,9 +181,9 @@ <refsect3 id="package.system.system-procwatch.intro.configuration.xml.rule.pattern"> <title>Rule Element: pattern</title> <para> - The <emphasis>pattern</emphasis> element describes the regular expression - which should be evaluated against a column of the output of - <command>ps</command>. + The <emphasis>pattern</emphasis> element describes the perl compatible + regular expression which should be evaluated against a column of the + output of <command>ps</command>. </para> <para> There is one required attribute, the <emphasis>match</emphasis> attribute, @@ -217,7 +217,7 @@ optional attribute, the required one being <emphasis>type</emphasis>, which MUST be one of &quot;presence&quot; or &quot;attr&quot;, and the optional one being <emphasis>attr</emphasis>. However, if the - <emphasis>type</emphasis> attribute equals &quot;attr&quot; the + <emphasis>type</emphasis> attribute equals to &quot;attr&quot; the <emphasis>attr</emphasis> attribute MUST be present. </para> <para> @@ -260,7 +260,7 @@ <emphasis>is</emphasis> </simpara> <simpara> - Found value MUST be defined value. + Found value MUST be equal to defined value. </simpara> </listitem> <listitem> @@ -268,7 +268,7 @@ <emphasis>isnot</emphasis> </simpara> <simpara> - Found value MUST NOT be defined value. + Found value MUST NOT be equal to defined value. </simpara> </listitem> <listitem> @@ -297,7 +297,7 @@ which MUST equal to one of &quot;shell&quot; or &quot;php&quot;. </para> <para> - Obviously the contents of the <emphasis>execute</emphasis> element + Obviously the content of the <emphasis>execute</emphasis> element is executed either on the shell through <function>shell_exec</function> or directly in PHP through <function>eval</function>. </para> @@ -445,7 +445,7 @@ ; Example INI file to configure System::ProcWatch ; ; Be aware that you only can define shell executes! -; For better configurablity use XML configuration files. +; For better configurability use XML configuration files. ; [httpd] pattern=/httpd/ @@ -473,5 +473,36 @@ </programlisting> </example> </refsect2> + + <refsect2 id="package.system.system-procwatch.intro.configuration.array"> + <title>PHP array</title> + <para> + A valid array to configure System::ProcWatch may look similar + to the following example. + </para> + </refsect2> + <refsect2> + <title>Example PHP configuration array</title> + <example id="package.system.system-procwatch.intro.configuration.array.example"> + <programlisting role="php"> +<![CDATA[ +$watches = array(); + +$watches['job1'] = array(); +$watches['job1']['pattern'] = array(); +$watches['job1']['condition'] = array(); +$watches['job1']['execute'] = array(); + +$watches['job1']['pattern']['command'] = '/httpd/'; +$watches['job1']['condition']['presence'] = array('min' => 10, 'max' => 100); +$watches['job1']['execute']['shell'] = array('/usr/bin/mail2admin $msg'); + +$watches['job2'] = array(); +// ... +]]> + </programlisting> + </example> + </refsect2> + </refsect1> </refentry> \ No newline at end of file

« previous php.pear.doc (#2352) next »