doc/rdocs/README_md.html in rcmd-1.6.1 vs doc/rdocs/README_md.html in rcmd-1.6.2
- old
+ new
@@ -62,10 +62,12 @@
<li><a href="#label-Usage+Examples">Usage Examples</a>
<li><a href="#label-Help+Screen">Help Screen</a>
<li><a href="#label-Specifying+nodes+manually">Specifying nodes manually</a>
<li><a href="#label-Piping+list+of+nodes">Piping list of nodes</a>
<li><a href="#label-Using+regex+to+build+node+list">Using regex to build node list</a>
+ <li><a href="#label-Database+backend+support">Database backend support</a>
+ <li><a href="#label-Database+backend+examples">Database backend examples</a>
<li><a href="#label-Development">Development</a>
</ul>
</div>
@@ -123,11 +125,17 @@
-r, --regexp regex Use Regex to build host list (ruby regexp)
-t, --threads threads Number of threads to run
-c, --command <command> Quoted string containing the command to be run
-q, --quiet Suppress stdout of commands. stderr will still be displayed
-v, --version Print what version of the command is in use
- -D, --debug Print debug information</pre>
+ -D, --debug Print debug information
+
+Database Options
+ -C, --create-config Create template dbconfig file in ~/.rcmd
+ -T, --type server-type Database query on server type
+ -H, --host hostname-pattern Database query on hostname (sql like query)
+ -O, --os operating-system Database query on Operating System string</pre>
<h2 id="label-Specifying+nodes+manually">Specifying nodes manually<span><a href="#label-Specifying+nodes+manually">¶</a> <a href="#top">↑</a></span></h2>
<p>Specifying a comma seperated list of hosts and timing the total execution
time. “`bash daibhidh@darkstar:~/$ time rcmd -n node1,node2,node3,node4 -c
@@ -163,9 +171,59 @@
node8 :: node8.example.com
node7 :: node7.example.com
node11 :: CONNECT ERROR :: Unable to connect to host!
node9 :: node9.example.com
node12 :: node12.example.com</pre>
+
+<h2 id="label-Database+backend+support">Database backend support<span><a href="#label-Database+backend+support">¶</a> <a href="#top">↑</a></span></h2>
+
+<p>The database backend support is provided by ActiveRecord and thus
+compatible with databases which are supported by ActiveRecord. Currently
+the ActiveRecord version is locked to 4.0.0 in the Gemspec due to
+compatibilty issues with RHEL, CentOS, and Mac OSx to name a few.</p>
+
+<p>To set up the database backend run rcmd with the '-C' switch first.
+This will create a database configuration file in ~/.rcmd named
+dbconfig.yml. In this file you can specify the adapter, and various other
+soptions for the database backend. For the queries to work properly, the
+:host_field: <em>MUST</em> be set so the command knows what column contains
+the host name.</p>
+
+<p>Two optional fields exist as well, which are type_field and os_field. While
+these are meant to represent “Server type (I.e. Web, DB, etc) and Operating
+System Name/version, you can map these to whatever fields you would like to
+be able to sort by. If these fields are not specified then using the
+associated command line options will result in a run time error.</p>
+
+<p>To minimize the size and possible issues with various backend adapters, no
+adapters are listed/installed when installing this Gem. It is up to you to
+install the correct adapter for the database you are wanting to connect to.</p>
+
+<p>The '-T' and '-O' options use strict matching in their
+queries where as the '-H' option uses a 'LIKE' query.</p>
+
+<h3 id="label-Database+backend+examples">Database backend examples<span><a href="#label-Database+backend+examples">¶</a> <a href="#top">↑</a></span></h3>
+
+<p>Hostname query (Match all systems whose hostname starts with node and
+contains at least two additional charectors): <code>bash
+daibhidh@darkstar:~/$ rcmd -H 'node%_' -c 'hostname -f'
+node20 :: node20.example.com node10 :: node10.example.com node12 ::
+node12.example.com node13 :: node13.example.com node15 ::
+node15.example.com node16 :: node16.example.com node18 ::
+node18.example.com node17 :: node17.example.com node11 ::
+node11.example.com node19 :: node19.example.com node14 ::
+node14.example.com </code></p>
+
+<p>Type query (Match all hosts listed as web servers): <code>bash
+daibhidh@darkstar:~/$ rcmd -T 'web' -c 'hostname -f' node11
+:: node11.example.com node19 :: node19.example.com node14 ::
+node14.example.com </code></p>
+
+<p>OS query (Match all hosts listed as running slackware): <code>bash
+daibhidh@darkstar:~/$ rcmd -o 'slackware' -c 'hostname -f'
+node10 :: node10.example.com node12 :: node12.example.com node18 ::
+node18.example.com node17 :: node17.example.com node11 ::
+node11.example.com </code></p>
<h1 id="label-Development">Development<span><a href="#label-Development">¶</a> <a href="#top">↑</a></span></h1>
<p>If you are wanting to modify the code by all means do so. If you clone this
repository you can then run <code>bundle install</code> to install the