/usr/share/doc/glances/html/config.html is in glances-doc 2.11.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | <!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Configuration — Glances 2.11.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="Glances 2.11.1 documentation" href="index.html"/>
<link rel="next" title="Anatomy Of The Application" href="aoa/index.html"/>
<link rel="prev" title="Command Reference" href="cmds.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Glances
</a>
<div class="version">
2.11.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Install</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="cmds.html">Command Reference</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Configuration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#location">Location</a></li>
<li class="toctree-l2"><a class="reference internal" href="#syntax">Syntax</a></li>
<li class="toctree-l2"><a class="reference internal" href="#logging">Logging</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="aoa/index.html">Anatomy Of The Application</a></li>
<li class="toctree-l1"><a class="reference internal" href="gw/index.html">Gateway To Other Services</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="support.html">Support</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Glances</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Configuration</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="configuration">
<span id="config"></span><h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h1>
<p>No configuration file is mandatory to use Glances.</p>
<p>Furthermore a configuration file is needed to access more settings.</p>
<div class="section" id="location">
<h2>Location<a class="headerlink" href="#location" title="Permalink to this headline">¶</a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">A template is available in the <code class="docutils literal"><span class="pre">/usr{,/local}/share/doc/glances</span></code>
(Unix-like) directory or directly on <a class="reference external" href="https://raw.githubusercontent.com/nicolargo/glances/master/conf/glances.conf">GitHub</a>.</p>
</div>
<p>You can put your own <code class="docutils literal"><span class="pre">glances.conf</span></code> file in the following locations:</p>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
<col width="75%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">Linux</span></code>, <code class="docutils literal"><span class="pre">SunOS</span></code></td>
<td>~/.config/glances, /etc/glances</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">*BSD</span></code></td>
<td>~/.config/glances, /usr/local/etc/glances</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">macOS</span></code></td>
<td>~/Library/Application Support/glances, /usr/local/etc/glances</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">Windows</span></code></td>
<td>%APPDATA%\glances</td>
</tr>
</tbody>
</table>
<ul class="simple">
<li>On Windows XP, <code class="docutils literal"><span class="pre">%APPDATA%</span></code> is: <code class="docutils literal"><span class="pre">C:\Documents</span> <span class="pre">and</span> <span class="pre">Settings\<USERNAME>\Application</span> <span class="pre">Data</span></code>.</li>
<li>On Windows Vista and later: <code class="docutils literal"><span class="pre">C:\Users\<USERNAME>\AppData\Roaming</span></code>.</li>
</ul>
<p>User-specific options override system-wide options and options given on
the command line override either.</p>
</div>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<p>Glances reads configuration files in the <em>ini</em> syntax.</p>
<p>A first section (called global) is available:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[global]</span>
<span class="c1"># Does Glances should check if a newer version is available on PyPI?</span>
<span class="na">check_update</span><span class="o">=</span><span class="s">true</span>
</pre></div>
</div>
<p>Each plugin, export module and application monitoring process (AMP) can
have a section. Below an example for the CPU plugin:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[cpu]</span>
<span class="na">user_careful</span><span class="o">=</span><span class="s">50</span>
<span class="na">user_warning</span><span class="o">=</span><span class="s">70</span>
<span class="na">user_critical</span><span class="o">=</span><span class="s">90</span>
<span class="na">iowait_careful</span><span class="o">=</span><span class="s">50</span>
<span class="na">iowait_warning</span><span class="o">=</span><span class="s">70</span>
<span class="na">iowait_critical</span><span class="o">=</span><span class="s">90</span>
<span class="na">system_careful</span><span class="o">=</span><span class="s">50</span>
<span class="na">system_warning</span><span class="o">=</span><span class="s">70</span>
<span class="na">system_critical</span><span class="o">=</span><span class="s">90</span>
<span class="na">steal_careful</span><span class="o">=</span><span class="s">50</span>
<span class="na">steal_warning</span><span class="o">=</span><span class="s">70</span>
<span class="na">steal_critical</span><span class="o">=</span><span class="s">90</span>
</pre></div>
</div>
<p>an InfluxDB export module:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[influxdb]</span>
<span class="c1"># Configuration for the --export-influxdb option</span>
<span class="c1"># https://influxdb.com/</span>
<span class="na">host</span><span class="o">=</span><span class="s">localhost</span>
<span class="na">port</span><span class="o">=</span><span class="s">8086</span>
<span class="na">user</span><span class="o">=</span><span class="s">root</span>
<span class="na">password</span><span class="o">=</span><span class="s">root</span>
<span class="na">db</span><span class="o">=</span><span class="s">glances</span>
<span class="na">prefix</span><span class="o">=</span><span class="s">localhost</span>
<span class="c1">#tags=foo:bar,spam:eggs</span>
</pre></div>
</div>
<p>or a Nginx AMP:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[amp_nginx]</span>
<span class="c1"># Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/)</span>
<span class="na">enable</span><span class="o">=</span><span class="s">true</span>
<span class="na">regex</span><span class="o">=</span><span class="s">\/usr\/sbin\/nginx</span>
<span class="na">refresh</span><span class="o">=</span><span class="s">60</span>
<span class="na">one_line</span><span class="o">=</span><span class="s">false</span>
<span class="na">status_url</span><span class="o">=</span><span class="s">http://localhost/nginx_status</span>
</pre></div>
</div>
</div>
<div class="section" id="logging">
<h2>Logging<a class="headerlink" href="#logging" title="Permalink to this headline">¶</a></h2>
<p>Glances logs all of its internal messages to a log file.</p>
<p><code class="docutils literal"><span class="pre">DEBUG</span></code> messages can been logged using the <code class="docutils literal"><span class="pre">-d</span></code> option on the command
line.</p>
<p>By default, the <code class="docutils literal"><span class="pre">glances-USERNAME.log</span></code> file is under the temporary directory:</p>
<table border="1" class="docutils">
<colgroup>
<col width="65%" />
<col width="35%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">*nix</span></code></td>
<td>/tmp</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">Windows</span></code></td>
<td>%TEMP%</td>
</tr>
</tbody>
</table>
<ul class="simple">
<li>On Windows XP, <code class="docutils literal"><span class="pre">%TEMP%</span></code> is: <code class="docutils literal"><span class="pre">C:\Documents</span> <span class="pre">and</span> <span class="pre">Settings\<USERNAME>\Local</span> <span class="pre">Settings\Temp</span></code>.</li>
<li>On Windows Vista and later: <code class="docutils literal"><span class="pre">C:\Users\<USERNAME>\AppData\Local\Temp</span></code>.</li>
</ul>
<p>If you want to use another system path or change the log message, you
can use your own logger configuration. First of all, you have to create
a <code class="docutils literal"><span class="pre">glances.json</span></code> file with, for example, the following content (JSON
format):</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">"version"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">"disable_existing_loggers"</span><span class="p">:</span> <span class="s2">"False"</span><span class="p">,</span>
<span class="nt">"root"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"INFO"</span><span class="p">,</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">]</span>
<span class="p">},</span>
<span class="nt">"formatters"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"standard"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"format"</span><span class="p">:</span> <span class="s2">"%(asctime)s -- %(levelname)s -- %(message)s"</span>
<span class="p">},</span>
<span class="nt">"short"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"format"</span><span class="p">:</span> <span class="s2">"%(levelname)s: %(message)s"</span>
<span class="p">},</span>
<span class="nt">"free"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"format"</span><span class="p">:</span> <span class="s2">"%(message)s"</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"file"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"DEBUG"</span><span class="p">,</span>
<span class="nt">"class"</span><span class="p">:</span> <span class="s2">"logging.handlers.RotatingFileHandler"</span><span class="p">,</span>
<span class="nt">"formatter"</span><span class="p">:</span> <span class="s2">"standard"</span><span class="p">,</span>
<span class="nt">"filename"</span><span class="p">:</span> <span class="s2">"/var/tmp/glances.log"</span>
<span class="p">},</span>
<span class="nt">"console"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"CRITICAL"</span><span class="p">,</span>
<span class="nt">"class"</span><span class="p">:</span> <span class="s2">"logging.StreamHandler"</span><span class="p">,</span>
<span class="nt">"formatter"</span><span class="p">:</span> <span class="s2">"free"</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">"loggers"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"debug"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"DEBUG"</span>
<span class="p">},</span>
<span class="nt">"verbose"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"INFO"</span>
<span class="p">},</span>
<span class="nt">"standard"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"INFO"</span>
<span class="p">},</span>
<span class="nt">"requests"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"ERROR"</span>
<span class="p">},</span>
<span class="nt">"elasticsearch"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"ERROR"</span>
<span class="p">},</span>
<span class="nt">"elasticsearch.trace"</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">"handlers"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"file"</span><span class="p">,</span> <span class="s2">"console"</span><span class="p">],</span>
<span class="nt">"level"</span><span class="p">:</span> <span class="s2">"ERROR"</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>and start Glances using the following command line:</p>
<div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">LOG_CFG=<path>/glances.json glances</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Replace <code class="docutils literal"><span class="pre"><path></span></code> by the folder where your <code class="docutils literal"><span class="pre">glances.json</span></code> file
is hosted.</p>
</div>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="aoa/index.html" class="btn btn-neutral float-right" title="Anatomy Of The Application" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="cmds.html" class="btn btn-neutral" title="Command Reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2018, Nicolas Hennion.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.11.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|