<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>FileProbes — Bcfg2 1.3.0 documentation</title> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../../', VERSION: '1.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/sidebar.js"></script> <link rel="shortcut icon" href="../../../_static/favicon.ico"/> <link rel="top" title="Bcfg2 1.3.0 documentation" href="../../../index.html" /> <link rel="up" title="Probes" href="index.html" /> <link rel="next" title="Admin" href="../../admin/index.html" /> <link rel="prev" title="Ohai" href="ohai.html" /> <link rel="stylesheet" href="../../../_static/bcfg2.css" type=""/> </head> <body> <div style="text-align: left; padding: 10px 10px 15px 15px"> <a href="../../../index.html"><img src="../../../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="../../admin/index.html" title="Admin" accesskey="N">next</a> |</li> <li class="right" > <a href="ohai.html" title="Ohai" accesskey="P">previous</a> |</li> <li><a href="../../../index.html">home</a> | </li> <!--<li><a href="../../../search.html">search</a> | </li>--> <li><a href="../../../help/index.html">help</a> | </li> <li><a href="../../../contents.html">documentation </a> »</li> <li><a href="../../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../../index.html" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" >Plugins</a> »</li> <li><a href="index.html" accesskey="U">Probes</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="fileprobes"> <span id="server-plugins-probes-fileprobes"></span><h1>FileProbes<a class="headerlink" href="#fileprobes" title="Permalink to this headline">¶</a></h1> <p>The FileProbes plugin allows you to probe a client for a file, which is then added to the <a class="reference internal" href="../generators/cfg.html#server-plugins-generators-cfg"><em>Cfg</em></a> specification. If the file changes on the client, FileProbes can either update it in the specification or allow Cfg to replace it.</p> <p>FileProbes will not probe a file if there’s already a file in Cfg that will apply to the client. So if, for instance, you have a generic file in <tt class="docutils literal"><span class="pre">Cfg/etc/foo.conf/foo.conf</span></tt> that applies to all hosts, FileProbes will not retrieve <tt class="docutils literal"><span class="pre">/etc/foo.conf</span></tt> from the client (unless <tt class="docutils literal"><span class="pre">update</span></tt> is enabled; see <a class="reference internal" href="#configuration">Configuration</a> below).</p> <p>When a new config file is first probed, an <tt class="docutils literal"><span class="pre">info.xml</span></tt> file is also written to enforce the permissions from that client. Subsequent probes from other clients will not modify or overwrite the data in <tt class="docutils literal"><span class="pre">info.xml</span></tt>. (This ensures that any manual changes you make to <tt class="docutils literal"><span class="pre">info.xml</span></tt> for that file are not circumvented.)</p> <div class="section" id="configuration"> <h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2> <p>FileProbes is configured in <tt class="docutils literal"><span class="pre">FileProbes/config.xml</span></tt>, which might look something like:</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><FileProbes></span> <span class="nt"><FileProbe</span> <span class="na">name=</span><span class="s">"/etc/foo.conf"</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">"blah-servers"</span><span class="nt">></span> <span class="nt"><FileProbe</span> <span class="na">name=</span><span class="s">"/etc/blah.conf"</span> <span class="na">update=</span><span class="s">"true"</span><span class="nt">/></span> <span class="nt"></Group></span> <span class="nt"><Client</span> <span class="na">name=</span><span class="s">"bar.example.com"</span><span class="nt">></span> <span class="nt"><FileProbe</span> <span class="na">name=</span><span class="s">"/var/lib/bar.gz"</span> <span class="na">encoding=</span><span class="s">"base64"</span><span class="nt">/></span> <span class="nt"></Client></span> <span class="nt"></FileProbes></span> </pre></div> </div> <p>This will result in <tt class="docutils literal"><span class="pre">/etc/foo.conf</span></tt> being retrieved from all clients; if it changes on a client, it will be overwritten by the version that was retrieved initially.</p> <p>Clients in the <tt class="docutils literal"><span class="pre">blah-servers</span></tt> group will be probed for <tt class="docutils literal"><span class="pre">/etc/blah.conf</span></tt>; if it changes on a client, those changes will be written into the Bcfg2 specification. If the file is deleted from a client, it will be rewritten from Bcfg2.</p> <p><tt class="docutils literal"><span class="pre">bar.example.com</span></tt> will be probed for <tt class="docutils literal"><span class="pre">/var/lib/bar.gz</span></tt>, which contains non-ASCII characters and so needs to use base64 encoding when transferring the file.</p> <p>The paths probed by FileProbes must also be included as Path entries in your bundles in order to be handled properly by Cfg. Permissions are handled as usual, with <tt class="docutils literal"><span class="pre">info.xml</span></tt> files in Cfg.</p> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">FileProbes</a><ul> <li><a class="reference internal" href="#configuration">Configuration</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="ohai.html" title="previous chapter">Ohai</a></p> <h4>Next topic</h4> <p class="topless"><a href="../../admin/index.html" title="next chapter">Admin</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../../_sources/server/plugins/probes/fileprobes.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="../../admin/index.html" title="Admin" >next</a> |</li> <li class="right" > <a href="ohai.html" title="Ohai" >previous</a> |</li> <li><a href="../../../index.html">home</a> | </li> <!--<li><a href="../../../search.html">search</a> | </li>--> <li><a href="../../../help/index.html">help</a> | </li> <li><a href="../../../contents.html">documentation </a> »</li> <li><a href="../../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../../index.html" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" >Plugins</a> »</li> <li><a href="index.html" >Probes</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Narayan Desai. Last updated on Mar 20, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>