Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 3a2887037f7441f622f09bf8edf799a4 > files > 17

python-hpilo-2.8-4.mga5.noarch.rpm



<!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>hpilo_cli command-line tool &mdash; python-hpilo 2.8 documentation</title>
    
    <link rel="stylesheet" href="_static/cloud.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noticia+Text|Open+Sans|Droid+Sans+Mono" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.8',
        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/jquery.cookie.js"></script>
    <script type="text/javascript" src="_static/cloud.js"></script>
    <link rel="top" title="python-hpilo 2.8 documentation" href="index.html" />
    <link rel="next" title="Dealing with iLO firmware updates" href="firmware.html" />
    <link rel="prev" title="Example output of API calls" href="output.html" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <div class="relbar-top">
        
    <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="firmware.html" title="Dealing with iLO firmware updates"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="output.html" title="Example output of API calls"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">python-hpilo 2.8 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="hpilo-cli-command-line-tool">
<h1>hpilo_cli command-line tool<a class="headerlink" href="#hpilo-cli-command-line-tool" title="Permalink to this headline">ΒΆ</a></h1>
<p>The commandline interface allows you to make calls from your shell or scripts
written in another language than python. It supports all methods that the
library has and is used as follows:</p>
<div class="highlight-python"><div class="highlight"><pre>Usage:
  hpilo_cli [options] hostname method [args...]
  hpilo_cli download_rib_firmware ilotype version [version...] &quot;&quot;&quot;

Options:
  -l LOGIN, --login=LOGIN
                        Username to access the iLO
  -p PASSWORD, --password=PASSWORD
                        Password to access the iLO
  -i, --interactive     Prompt for username and/or password if they are not
                        specified.
  -c FILE, --config=FILE
                        File containing authentication and config details
  -t TIMEOUT, --timeout=TIMEOUT
                        Timeout for iLO connections
  -j, --json            Output a json document instead of a python dict
  -y, --yaml            Output a yaml document instead of a python dict
  -P PROTOCOL, --protocol=PROTOCOL
                        Use the specified protocol instead of autodetecting
  -d, --debug           Output debug information, repeat to see all XML data
  -o PORT, --port=PORT  SSL port to connect to
  --untested            Allow untested methods
  -h, --help            show this help message or help for a method
  -H, --help-methods    show all supported methods
</pre></div>
</div>
<p>The configuration file (by default <tt class="file docutils literal"><span class="pre">~/.ilo.conf</span></tt> is a simple ini file
that should look like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">ilo</span><span class="p">]</span>
<span class="n">login</span> <span class="o">=</span> <span class="n">Administrator</span>
<span class="n">password</span> <span class="o">=</span> <span class="n">AdminPassword</span>
</pre></div>
</div>
<p>Using such a file is recommended over using the login/password commandline
arguments. A full example config file is shipped with the hpilo distribution.</p>
<p>To pass arguments to method calls, pass <tt class="xref py py-attr docutils literal"><span class="pre">key=value</span></tt> pairs on the
command-line. These can reference arbitrary configuration variables using
<tt class="xref py py-attr docutils literal"><span class="pre">key='$section.option'</span></tt>.</p>
<p>You can also call multiple methds at once by separating them with a <tt class="xref py py-data docutils literal"><span class="pre">+</span></tt></p>
<p>Some examples will make it clearer, so here are a few:</p>
<p>Getting the status of the UID light:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli example-server.int.kaarsemaker.net get_uid_status
&gt;&gt;&gt; print(my_ilo.get_uid_status())
OFF
</pre></div>
</div>
<p>Getting virtual cdrom status in JSON format:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli example-server.int.kaarsemaker.net get_vm_status --json
{&quot;write_protect&quot;: &quot;NO&quot;, &quot;vm_applet&quot;: &quot;DISCONNECTED&quot;, &quot;image_url&quot;: &quot;&quot;, &quot;boot_option&quot;: &quot;NO_BOOT&quot;, &quot;device&quot;: &quot;CDROM&quot;, &quot;image_inserted&quot;: &quot;NO&quot;}
</pre></div>
</div>
<p>Setting the name of the server:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli example-server.int.kaarsemaker.net set_server_name name=example-server
</pre></div>
</div>
<p>Displaying help for the <tt class="xref py py-func docutils literal"><span class="pre">get_host_data()</span></tt> method:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli --help get_host_data
Ilo.get_host_data [decoded_only=True]:
Get SMBIOS records that describe the host. By default only the ones
where human readable information is available are returned. To get
all records pass decoded_only=False
</pre></div>
</div>
<p>Methods like <tt class="xref py py-func docutils literal"><span class="pre">mod_network_data()</span></tt> method require hashes as arguments, you
can use the following syntax:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli example-server.int.kaarsemaker.net mod_network_settings static_route_1.dest=1.2.3.4 static_route_1.gateway=10.10.10.254
</pre></div>
</div>
<p>Calling multiple methods:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli example-server.int.kaarsemaker.net get_uid_status + uid_control uid=No + get_uid_status
&gt;&gt;&gt; print(my_ilo.get_uid_status())
ON
&gt;&gt;&gt; my_ilo.uid_control(uid=&quot;No&quot;)
&gt;&gt;&gt; print(my_ilo.get_uid_status())
OFF
</pre></div>
</div>
<p>Setting a licence key defined in the config file:</p>
<div class="highlight-python"><div class="highlight"><pre>$ cat ~/.ilo.conf
[ilo]
login = Administrator
password = AdminPass

[license]
ilo3_advanced = FAKEL-ICENS-EFORH-PILO3-XXXXX

$ hpilo_cli example-server.int.kaarsemaker.net activate_license key=&#39;$license.ilo3_advanced&#39;
</pre></div>
</div>
<p>Using hponcfg to talk to the local iLO device to reset the password without knowing it:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli -P local localhost mod_user user_login=Administrator password=NewPassword
</pre></div>
</div>
<p>-P local is optional when specifying localhost as hostname, so this works too:</p>
<div class="highlight-python"><div class="highlight"><pre>$ hpilo_cli localhost mod_user user_login=Administrator password=NewPassword
</pre></div>
</div>
<p>If hponcfg is not at <tt class="file docutils literal"><span class="pre">/sbin/hponcfg</span></tt> or
<tt class="file docutils literal"><span class="pre">C:\Program</span> <span class="pre">Files\HP</span> <span class="pre">Lights-Out</span> <span class="pre">Configuration</span> <span class="pre">Utility\cpqlocfg.exe</span></tt>, you
can set an alternative path in the config, see the example config file.</p>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
        <p class="logo"><a href="index.html" title="index">
          <img class="logo" src="_static/lightbulb.png" alt="Logo"/>
        </a></p>
  <div class="sphinxprev">
    <h4>Previous page</h4>
    <p class="topless"><a href="output.html"
                          title="Previous page">&larr; Example output of API calls</a></p>
  </div>
  <div class="sphinxnext">
    <h4>Next page</h4>
    <p class="topless"><a href="firmware.html"
                          title="Next page">&rarr; Dealing with iLO firmware updates</a></p>
  </div>
<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="relbar-bottom">
        
    <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="firmware.html" title="Dealing with iLO firmware updates"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="output.html" title="Example output of API calls"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">python-hpilo 2.8 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    </div>

    <div class="footer">
        &copy; Copyright 2011-2014, Dennis Kaarsemaker.
    </div>
    <!-- cloud_sptheme 1.4 -->
  </body>
</html>