cvs: peardoc /en/package/system system-procwatch.xml /en/package/system/system-procwatch constants.xml system-procwatch-config.xml
system-procwatch-parser.xml system-procwatch.xml /en/package/system/system-procwatch/system-procwatch daemon.xml run.xml setconfig.xml
system_procwatch.xml /en/package/system/system-procwatch/system-procwatch-config fromarray.xml frominifile.xml fromxml.xml fromxmlfile.xml
/en/package/system/system-procwatch/system-procwatch-parser fetch.xml getparseddata.xml getprocbypid.xml getprocinfo.xml parse.xml
system_procwatch_parser.xml

From: Date: Sat, 22 Nov 2003 20:15:17 +0000
Subject: cvs: peardoc /en/package/system system-procwatch.xml /en/package/system/system-procwatch constants.xml system-procwatch-config.xml
system-procwatch-parser.xml system-procwatch.xml /en/package/system/system-procwatch/system-procwatch daemon.xml run.xml setconfig.xml
system_procwatch.xml /en/package/system/system-procwatch/system-procwatch-config fromarray.xml frominifile.xml fromxml.xml fromxmlfile.xml
/en/package/system/system-procwatch/system-procwatch-parser fetch.xml getparseddata.xml getprocbypid.xml getprocinfo.xml parse.xml
system_procwatch_parser.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1969@lists.php.net to get a copy of this message
mike Sat Nov 22 15:15:17 2003 EDT Added files: /peardoc/en/package/system system-procwatch.xml /peardoc/en/package/system/system-procwatch constants.xml system-procwatch-config.xml system-procwatch-parser.xml system-procwatch.xml /peardoc/en/package/system/system-procwatch/system-procwatch-config fromarray.xml frominifile.xml fromxml.xml fromxmlfile.xml /peardoc/en/package/system/system-procwatch/system-procwatch-parser fetch.xml getparseddata.xml getprocbypid.xml getprocinfo.xml parse.xml system_procwatch_parser.xml /peardoc/en/package/system/system-procwatch/system-procwatch daemon.xml run.xml setconfig.xml system_procwatch.xml Log: added first docs for System_ProcWatch

Index: peardoc/en/package/system/system-procwatch.xml +++ peardoc/en/package/system/system-procwatch.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.system.system-procwatch"> <title>System_ProcWatch</title> &package.system.system-procwatch.system-procwatch; &package.system.system-procwatch.system-procwatch-config; &package.system.system-procwatch.system-procwatch-parser; &package.system.system-procwatch.constants; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/constants.xml +++ peardoc/en/package/system/system-procwatch/constants.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.constants"> <refnamediv> <refname>Constants</refname> <refpurpose>Constants defined in and used by System_ProcWatch</refpurpose> </refnamediv> <refsect1 id="package.system.system-procwatch.constants.details"> <title>All Constants</title> <refsect2 id="package.system.system-procwatch.constants.details.procwatch---php"> <title> Constants defined in ProcWatch.php </title> <para> This constants are mostly used internally by System_ProcWatch </para> <para> <table> <title>Constants defined in ProcWatch.php</title> <tgroup cols="2"> <thead> <row> <entry>Name</entry> <entry>Value</entry> </row> </thead> <tbody> <row> <entry>PHP_PROCWATCH_IS</entry> <entry>103</entry> </row> <row> <entry>PHP_PROCWATCH_ISNOT</entry> <entry>104</entry> </row> <row> <entry>PHP_PROCWATCH_MAX</entry> <entry>106</entry> </row> <row> <entry>PHP_PROCWATCH_MIN</entry> <entry>105</entry> </row> <row> <entry>PHP_PROCWATCH_PRESENCE</entry> <entry>100</entry> </row> <row> <entry>PHP_PROCWATCH_PRESENCE_MAX</entry> <entry>102</entry> </row> <row> <entry>PHP_PROCWATCH_PRESENCE_MIN</entry> <entry>101</entry> </row> <row> <entry>PHP_PROCWATCH_SUM</entry> <entry>107</entry> </row> </tbody> </tgroup> </table> </para> </refsect2> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-config.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-config.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-config"> <refnamediv> <refname><classname>System_ProcWatch_Config</classname></refname> <refpurpose>System_ProcWatch_Config</refpurpose> </refnamediv> <refsect1> <title>System_ProcWatch_Config</title> <para>Build a configuration array for System_ProcWatch</para> <para>Usage: <programlisting role="php-highlighted"> 1 $cf = <link linkend="package.system.system-procwatch.system-procwatch-config">System_ProcWatch_Config</link>::<link linkend="package.system.system-procwatch.system-procwatch-config.fromxmlfile">fromXmlFile</link>(&apos;/etc/procwatch.xml&apos;); 2 $pw = &amp;new <link linkend="package.system.system-procwatch.system-procwatch">System_ProcWatch</link>($cf); </programlisting> </para> </refsect1> </refentry> &package.system.system-procwatch.system-procwatch-config.fromxml; &package.system.system-procwatch.system-procwatch-config.fromxmlfile; &package.system.system-procwatch.system-procwatch-config.frominifile; &package.system.system-procwatch.system-procwatch-config.fromarray; <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser"> <refnamediv> <refname><classname>System_ProcWatch_Parser</classname></refname> <refpurpose>System_ProcWatch_Parser</refpurpose> </refnamediv> <refsect1> <title>System_ProcWatch_Parser</title> <para>Fetches output from `ps` and parses it into an associative array</para> <para>Usage: <programlisting role="php-highlighted"> 1 $ps = &amp;new <link linkend="package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser">System_ProcWatch_Parser</link>(); 2 $pd = &amp;$ps-&gt;<link linkend="package.system.system-procwatch.system-procwatch-parser.getparseddata">getParsedData</link>(); </programlisting> </para> </refsect1> </refentry> &package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser; &package.system.system-procwatch.system-procwatch-parser.getparseddata; &package.system.system-procwatch.system-procwatch-parser.fetch; &package.system.system-procwatch.system-procwatch-parser.parse; &package.system.system-procwatch.system-procwatch-parser.getprocbypid; &package.system.system-procwatch.system-procwatch-parser.getprocinfo; <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch"> <refnamediv> <refname><classname>System_ProcWatch</classname></refname> <refpurpose>System_ProcWatch</refpurpose> </refnamediv> <refsect1> <title>System_ProcWatch</title> <para>Monitor processes</para> <para>Usage: <programlisting role="php-highlighted"> 1 require_once &apos;System/ProcWatch.php&apos;; 2 require_once &apos;System/ProcWatch/Config.php&apos;; 3 4 $cf = <link linkend="package.system.system-procwatch.system-procwatch-config">System_ProcWatch_Config</link>::<link linkend="package.system.system-procwatch.system-procwatch-config.fromxmlfile">fromXmlFile</link>(&apos;/etc/procwatch.xml&apos;); 5 $pw = &amp;new <link linkend="package.system.system-procwatch.system-procwatch.system-procwatch">System_ProcWatch</link>($cf); 6 $pw-&gt;<link linkend="package.system.system-procwatch.system-procwatch.run">run</link>();</programlisting> </para> </refsect1> </refentry> &package.system.system-procwatch.system-procwatch.system-procwatch; &package.system.system-procwatch.system-procwatch.run; &package.system.system-procwatch.system-procwatch.daemon; &package.system.system-procwatch.system-procwatch.setconfig; <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-config/fromarray.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-config/fromarray.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-config.fromarray"> <refnamediv> <refname><function>System_ProcWatch_Config::fromArray</function></refname> <refpurpose>Get config array from an array :)</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;System/ProcWatch/Config.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System_ProcWatch_Config::fromArray</function></funcdef> <paramdef>mixed <parameter>$array</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromarray.desc"> &title.desc; <para> This method in fact does a sanity check on the supplied config array and should only be used for testing purposes. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromarray.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$array</parameter> </term> <listitem> <para> config array to check </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromarray.return"> &title.returns; <para> Returns the same &type.array; on success or <classname>PEAR_Error</classname> on failure. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromarray.throws"> &title.throws; <para> Throws <classname>PEAR_Error</classname> if an invalid configuration array was supplied. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromarray.note"> &title.note; &note.shouldstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-config/frominifile.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-config/frominifile.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-config.frominifile"> <refnamediv> <refname><function>System_ProcWatch_Config::fromIniFile</function></refname> <refpurpose>Get config array from INI file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;System/ProcWatch/Config.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System_ProcWatch_Config::fromIniFile</function></funcdef> <paramdef>string <parameter>$file</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-config.frominifile.desc"> &title.desc; <para> Parses an INI file into an array to configure System_ProcWatch with. </para> <example id="package.system.system-procwatch.system-procwatch-config.frominifile.example"> <title>INI configuration file</title> <programlisting> <![CDATA[ ; ; Example INI file to configure System::ProcWatch ; ; Be aware that you only can define shell executes! ; For better configurablity use XML configuration files. ; [httpd] pattern=/httpd/ match=command condition=presence min=10 max=50 execute="echo $msg >> /var/log/procwatch" [zombies] pattern=/Z/ match=stat condition=presence max=0 execute="kill -9 `echo $pids | sed s/[,\(\)]//g`" [mysqld-mem] pattern=/mysqld/ match=command condition=attr attr=%mem sum=10 execute="echo $msg >> /var/log/procwatch" ]]> </programlisting> </example> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.frominifile.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$file</parameter> </term> <listitem> <para> path to INI file </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.frominifile.return"> &title.returns; <para> Returns config &type.array; on success or <classname>PEAR_Error</classname> on failure. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.frominifile.throws"> &title.throws; <para> Throws <classname>PEAR_Error</classname> if INI file doesn't exist. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.frominifile.note"> &title.note; &note.shouldstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-config/fromxml.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-config/fromxml.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-config.fromxml"> <refnamediv> <refname><function>System_ProcWatch_Config::fromXml</function></refname> <refpurpose>Get config array from XML string</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;System/ProcWatch/Config.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System_ProcWatch_Config::fromXml</function></funcdef> <paramdef>string <parameter>$xml</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxml.desc"> &title.desc; <para> Parses an XML string into an config array to configure System_ProcWatch with. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxml.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$xml</parameter> </term> <listitem> <para> XML string </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxml.return"> &title.returns; <para> Returns config &type.array; on success or <classname>PEAR_Error</classname> on fialure. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxml.throws"> &title.throws; <para> Throws <classname>PEAR_Error</classname> if XML file does not exist or problems parsing the XML string have occured. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxml.note"> &title.note; &note.shouldstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-config/fromxmlfile.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-config/fromxmlfile.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-config.fromxmlfile"> <refnamediv> <refname><function>System_ProcWatch_Config::fromXmlFile</function></refname> <refpurpose>Get config array from XML file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;System/ProcWatch/Config.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System_ProcWatch_Config::fromXmlFile</function></funcdef> <paramdef>string <parameter>$file</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.desc"> &title.desc; <para> Parses an XML file into an config array to configure System_ProcWatch with. </para> <example id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.example"> <title>XML configuration file</title> <programlisting> &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt; &lt;!DOCTYPE procwatch SYSTEM &quot;/usr/share/pear/data/System_ProcWatch/procwatch-1_0.dtd&quot;&gt; &lt;procwatch&gt; &lt;!-- SPECIAL VARIABLES ================= System_ProcWatch supplies the following special variables, which will be replaced in the string to execute: $msg - This contains a general message, what has happened. It is quoted in single quotes for save usage and is available in shell and php executes. $pids - This contains all PIDs of the processes that have been found. They are enclosed by single quotes and parenthesis. Example: '(433, 444, 455, 466)' $procs - This is a somewhat serialized php array in string format containing all information gained from ps and looks like: array(array('pid' =&gt; 344, 'command' =&gt; '/usr/sbin/httpd' ...)) It is only available in php executes and can easily be used in function callbacks: &lt;execute type=&quot;php&quot;&gt;get_procs($procs);&lt;/execute&gt; IMPORTANT NOTE ============== The values of the &quot;match&quot; attribute of the &quot;pattern&quot; element and the values of the &quot;attr&quot; attribute of the &quot;condition&quot; element are dependent on the output of ps - more exactly on the column heads of ps. Therefore System_ProcWatch and its configuration is highly adjustable. ############################################################################ SOME EXAMPLE CONFIGURATIONS =========================== This job looks for the count of running httpd processes by matching the PCRE &quot;/httpd/&quot; against the COMMAND column of ps. If there are less than 10 or more than 30 httpd processes found the speicified string is executed on the shell. --&gt; &lt;watch name=&quot;httpd-count&quot;&gt; &lt;pattern match=&quot;command&quot;&gt;/httpd/&lt;/pattern&gt; &lt;condition type=&quot;presence&quot;&gt; &lt;min&gt;10&lt;/min&gt; &lt;max&gt;30&lt;/max&gt; &lt;/condition&gt; &lt;execute type=&quot;shell&quot;&gt;echo $msg $pids &amp;gt;&amp;gt; /var/log/procwatch&lt;/execute&gt; &lt;/watch&gt; &lt;!-- This job looks for the amount of physical memory all httpd processes use together by matching the PCRE &quot;/httpd/&quot; against the COMMAND column of ps. It adds all %MEM columns of ps that match the pattern together and compares the reslut to the specified sum. If the result exceeds the sum the specified string is executet on the shell. --&gt; &lt;watch name=&quot;httpd-usage&quot;&gt; &lt;pattern match=&quot;command&quot;&gt;/httpd/&lt;/pattern&gt; &lt;condition type=&quot;attr&quot; attr=&quot;%mem&quot;&gt; &lt;sum&gt;5&lt;/sum&gt; &lt;/condition&gt; &lt;execute type=&quot;shell&quot;&gt;echo $msg $pids &amp;gt;&amp;gt; /var/log/procwatch&lt;/execute&gt; &lt;/watch&gt; &lt;!-- This job looks for zombie processes. It matches the PCRE &quot;/Z/&quot; against the STAT column of ps and executes the specified string on the shell if more than 0 zombies have been found. --&gt; &lt;watch name=&quot;ZOMBIES&quot;&gt; &lt;pattern match=&quot;stat&quot;&gt;/Z/&lt;/pattern&gt; &lt;condition type=&quot;presence&quot;&gt; &lt;max&gt;0&lt;/max&gt; &lt;/condition&gt; &lt;execute type=&quot;shell&quot;&gt;echo $msg $pids &amp;gt;&amp;gt; /var/log/procwatch&lt;/execute&gt; &lt;/watch&gt; &lt;!-- This job looks for running processes. It matches the PCRE pattern &quot;/R/&quot; against the STAT column of ps and executes the specified string on the shell if any running processes have been found. --&gt; &lt;watch name=&quot;running&quot;&gt; &lt;pattern match=&quot;stat&quot;&gt;/R/&lt;/pattern&gt; &lt;condition type=&quot;presence&quot; /&gt; &lt;execute type=&quot;shell&quot;&gt;echo $msg $pids &amp;gt;&amp;gt; /var/log/procwatch&lt;/execute&gt; &lt;/watch&gt; &lt;/procwatch&gt; </programlisting> </example> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$file</parameter> </term> <listitem> <para> paht to XML file </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.return"> &title.returns; <para> Returns config &type.array; on success or <classname>PEAR_Error</classname> on fialure. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.throws"> &title.throws; <para> Throws <classname>PEAR_Error</classname> if XML file does not exist, or problems parsing the XML file have occured. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-config.fromxmlfile.note"> &title.note; &note.shouldstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/fetch.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/fetch.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.fetch"> <refnamediv> <refname><function>System_ProcWatch_Parser::fetch</function></refname> <refpurpose>Fetch ps&apos; data</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>string <function>System_ProcWatch_Parser::fetch</function></funcdef> <paramdef>string <parameter> <optional>$ps_args = ''</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.fetch.desc"> &title.desc; <para> Fetches the output of ps, executed on the shell. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.fetch.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$ps_args</parameter> </term> <listitem> <para> ps&apos; arguments </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.fetch.return"> &title.returns; <para> Returns &type.string; ps&apos; output. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.fetch.throws"> &title.throws; <para> Throws no execption. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.fetch.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/getparseddata.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/getparseddata.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.getparseddata"> <refnamediv> <refname><function>System_ProcWatch_Parser::getParsedData</function></refname> <refpurpose>Get parsed data</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>array &amp;<function>System_ProcWatch_Parser::getParsedData</function></funcdef> <paramdef>string <parameter> <optional>$ps_args = 'aux'</optional></parameter></paramdef> <paramdef>bool <parameter> <optional>$refresh = &false;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getparseddata.desc"> &title.desc; <para> This is the main method of this class. It fetches to output of ps, executed on the shell, and returns the parsed data as an 2 dimensional indexed and associatve array. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getparseddata.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$ps_args</parameter> </term> <listitem> <para> ps&apos; arguments </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.bool; <parameter>$refresh</parameter> </term> <listitem> <para> whether to refresh our data </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getparseddata.return"> &title.returns; <para> Returns &type.array; of processes parsed from ps&apos; output. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getparseddata.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getparseddata.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/getprocbypid.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/getprocbypid.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.getprocbypid"> <refnamediv> <refname><function>System_ProcWatch_Parser::getProcByPid</function></refname> <refpurpose>Get info about a process by its PID</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>array <function>System_ProcWatch_Parser::getProcByPid</function></funcdef> <paramdef>int <parameter>$pid</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocbypid.desc"> &title.desc; <para> Get information about a process by its PID. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocbypid.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.int; <parameter>$pid</parameter> </term> <listitem> <para> the PID of the process </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocbypid.return"> &title.returns; <para> Returns &type.array; with information about the process with the supplied PID. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocbypid.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocbypid.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/getprocinfo.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/getprocinfo.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.getprocinfo"> <refnamediv> <refname><function>System_ProcWatch_Parser::getProcInfo</function></refname> <refpurpose>Get information about processes</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>array <function>System_ProcWatch_Parser::getProcInfo</function></funcdef> <paramdef>string <parameter>$pattern</parameter></paramdef> <paramdef>string <parameter>$search</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocinfo.desc"> &title.desc; <para> Get information about processes matching the defined search. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocinfo.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$pattern</parameter> </term> <listitem> <para> PCRE to match for process </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$search</parameter> </term> <listitem> <para> the ps field/column to search in </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocinfo.return"> &title.returns; <para> Returns &type.array; of processes matching the search. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocinfo.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.getprocinfo.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/parse.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/parse.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.parse"> <refnamediv> <refname><function>System_ProcWatch_Parser::parse</function></refname> <refpurpose>Parse</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>array <function>System_ProcWatch_Parser::parse</function></funcdef> <paramdef>string <parameter>$data</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.parse.desc"> &title.desc; <para> Parses the output of ps. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.parse.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$data</parameter> </term> <listitem> <para> output of ps </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.parse.return"> &title.returns; <para> Returns &type.array; of processes. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.parse.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.parse.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch-parser/system_procwatch_parser.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch-parser/system_procwatch_parser.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser"> <refnamediv> <refname><function>System_ProcWatch_Parser::System_ProcWatch_Parser</function></refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;ProcWatchParser.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>object &amp;new <function>System_ProcWatch_Parser</function></funcdef> <paramdef>string <parameter> <optional>$ps_args = 'aux'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser.desc"> &title.desc; <para> Instantiates a new System_ProcWatch parser object with the supplied arguments to pass to ps. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$ps_args</parameter> </term> <listitem> <para> ps&apos; arguments </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch-parser.system-procwatch-parser.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch/daemon.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch/daemon.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch.daemon"> <refnamediv> <refname><function>System_ProcWatch::daemon</function></refname> <refpurpose>Run in daemon mode</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>System_ProcWatch::daemon</function></funcdef> <paramdef>int <parameter>$interval</parameter></paramdef> <paramdef>string <parameter> <optional>$ps_args = 'aux'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch.daemon.desc"> &title.desc; <para> Runs System_ProcWatch in daemon mode with the defined interval of seconds to sleep. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.daemon.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.int; <parameter>$interval</parameter> </term> <listitem> <para> seconds to sleep </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$ps_args</parameter> </term> <listitem> <para> ps&apos; arguments </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.daemon.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.daemon.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch/run.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch/run.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch.run"> <refnamediv> <refname><function>System_ProcWatch::run</function></refname> <refpurpose>Run once</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>System_ProcWatch::run</function></funcdef> <paramdef>string <parameter> <optional>$ps_args = 'aux'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch.run.desc"> &title.desc; <para> Run once. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.run.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$ps_args</parameter> </term> <listitem> <para> arguments that should be passed to ps </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.run.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.run.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch/setconfig.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch/setconfig.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch.setconfig"> <refnamediv> <refname><function>System_ProcWatch::setConfig</function></refname> <refpurpose>Set configuration</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>System_ProcWatch::setConfig</function></funcdef> <paramdef>array <parameter>$config</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch.setconfig.desc"> &title.desc; <para> Configure System_ProcWatch with an config array from <link linkend="package.system.system-procwatch.system-procwatch-config"><classname>System_ProcWatch_Config</classname></link>. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.setconfig.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$config</parameter> </term> <listitem> <para> config array from <link linkend="package.system.system-procwatch.system-procwatch-config"><classname>System_ProcWatch_Config</classname></link> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.setconfig.throws"> &title.throws; <para> Throws no exception. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.setconfig.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/system/system-procwatch/system-procwatch/system_procwatch.xml +++ peardoc/en/package/system/system-procwatch/system-procwatch/system_procwatch.xml <!-- $Revision: 1.1 $ --> <refentry id="package.system.system-procwatch.system-procwatch.system-procwatch"> <refnamediv> <refname><function>System_ProcWatch::System_ProcWatch</function></refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;System/ProcWatch.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>object &amp;new <function>System_ProcWatch</function></funcdef> <paramdef>array <parameter>$config</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.system-procwatch.system-procwatch.system-procwatch.desc"> &title.desc; <para> Instantiate a new System_ProcWatch object configured by the supplied configuration array. </para> </refsect1> <refsect1 id="package.system.system-procwatch.system-procwatch.system-procwatch.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$config</parameter> </term> <listitem> <para> config array from <link linkend="package.system.system-procwatch.system-procwatch-config"><classname>System_ProcWatch_Config</classname></link> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#1969) next »