lemonldap-ng/doc/pages/documentation/current/status.html
2018-04-17 10:33:26 +02:00

200 lines
8.2 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>documentation:2.0:status</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,2.0,status"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="status.html"/>
<link rel="contents" href="status.html" title="Sitemap"/>
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/>
<!-- //if:usedebianlibs
<link rel="stylesheet" type="text/css" href="/javascript/bootstrap/css/bootstrap.min.css" />
//elsif:useexternallibs
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script>
//elsif:cssminified
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" />
<!-- //endif -->
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:status","namespace":"documentation:2.0"};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="lib/exe/js.php.t.bootstrap3.js"></script>
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.js"></script>
<!-- //endif -->
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery-ui/jquery-ui.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.js"></script>
<!-- //endif -->
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level1"><div class="li"><a href="#portal_status_experimental">Portal Status (experimental)</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#configuration">Configuration</a></div></li>
</ul>
</li>
<li class="level1"><div class="li"><a href="#handler_status">Handler Status</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#presentation">Presentation</a></div></li>
<li class="level2"><div class="li"><a href="#configuration1">Configuration</a></div>
<ul class="toc">
<li class="level3"><div class="li"><a href="#apache">Apache</a></div></li>
<li class="level3"><div class="li"><a href="#nginx">Nginx</a></div></li>
<li class="level3"><div class="li"><a href="#lemonldapng">LemonLDAP::NG</a></div></li>
</ul></li>
</ul></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="status_pages">Status pages</h1>
<div class="level1">
</div>
<!-- EDIT1 SECTION "Status pages" [1-28] -->
<h2 class="sectionedit2" id="portal_status_experimental">Portal Status (experimental)</h2>
<div class="level2">
<p>
The portal displays in JSON format its activity. Unlike handler, this is not the full activity of the server, but for now just the activity of 1 thread. This can give a view to all returned codes.
</p>
</div>
<!-- EDIT2 SECTION "Portal Status (experimental)" [29-268] -->
<h3 class="sectionedit3" id="configuration">Configuration</h3>
<div class="level3">
<p>
* Set <code>portalStatus = 1</code> in lemonldap-ng.ini file (section <code>[Portal]</code>)
* Protect <a href="http://portal/portalStatus" class="urlextern" title="http://portal/portalStatus" rel="nofollow">http://portal/portalStatus</a> using your webserver configuration
</p>
<p>
Status is displayed by calling this <abbr title="Uniform Resource Locator">URL</abbr>.
</p>
</div>
<!-- EDIT3 SECTION "Configuration" [269-485] -->
<h2 class="sectionedit4" id="handler_status">Handler Status</h2>
<div class="level2">
<div class="noteimportant">Since 2.0, Handler status no more collects Portal returned codes.
</div>
</div>
<!-- EDIT4 SECTION "Handler Status" [486-603] -->
<h3 class="sectionedit5" id="presentation">Presentation</h3>
<div class="level3">
<p>
When status feature is activated, Handlers and portal will collect statistics and save them in their local cache. This means that if several Handlers are deployed, each will manage its own statistics.
</p>
<div class="notetip">This page can be browsed for example by <a href="http://oss.oetiker.ch/mrtg/" class="urlextern" title="http://oss.oetiker.ch/mrtg/" rel="nofollow">MRTG</a> using the <a href="mrtg.html" class="wikilink1" title="documentation:2.0:mrtg">MRTG monitoring script</a>.
</div>
<p>
The statistics are collected trough a daemon launched by the Handler. It can be seen in system processes, for example:
</p>
<pre class="code">perl -MLemonldap::NG::Handler::Status -I/etc/perl -I/usr/local/lib/perl/5.10.1 -I/usr/local/share/perl/5.10.1 -I/usr/lib/perl5 -I/usr/share/perl5 -I/usr/lib/perl/5.10 -I/usr/share/perl/5.10 -I/usr/local/lib/site_perl -I. -I/etc/apache2 -e &amp;Lemonldap::NG::Handler::Status::run(Cache::FileCache,{? &#039;cache_depth&#039; =&gt; 5,? &#039;cache_root&#039; =&gt; &#039;/tmp&#039;,? &#039;directory_umask&#039; =&gt; &#039;007&#039;,? &#039;default_expires_in&#039; =&gt; 600,? &#039;namespace&#039; =&gt; &#039;MyNamespace&#039;? }?);</pre>
<p>
Statistics are displayed when calling the status path on an Handler (for example: <a href="http://test1.example.com/status" class="urlextern" title="http://test1.example.com/status" rel="nofollow">http://test1.example.com/status</a>).
</p>
<p>
Example of status page:
</p>
<p>
<a href="documentation/status_standard.png_documentation_2.0_status.html" class="media" title="documentation:status_standard.png"><img src="documentation/status_standard.png" class="mediacenter" alt="" /></a>
</p>
</div>
<!-- EDIT5 SECTION "Presentation" [604-1777] -->
<h3 class="sectionedit6" id="configuration1">Configuration</h3>
<div class="level3">
</div>
<h4 id="apache">Apache</h4>
<div class="level4">
<p>
You need to give access to status path in the Handler Apache configuration:
</p>
<pre class="code file apache"> <span class="co1"># Uncomment this to activate status module</span>
&lt;<span class="kw3">Location</span> /status&gt;
<span class="kw1">Order</span> <span class="kw1">deny</span>,<span class="kw1">allow</span>
<span class="kw1">Allow</span> from 127.0.0.0/<span class="nu0">8</span>
PerlHeaderParserHandler Lemonldap::NG::Handler-&gt;status
&lt;/<span class="kw3">Location</span>&gt;</pre>
<p>
Then restart Apache.
</p>
<div class="notetip">You should change the <code>Allow</code> directive to match administration <abbr title="Internet Protocol">IP</abbr>, or use another Apache protection mean.
</div>
</div>
<h4 id="nginx">Nginx</h4>
<div class="level4">
<p>
You need to give access to status path in the Handler Nginx configuration:
</p>
<pre class="code file nginx">server {
listen __PORT__;
server_name reload.__DNSDOMAIN__;
root /var/www/html;
...
location = /status {
allow 127.0.0.1;
deny all;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
fastcgi_param LLTYPE status;
}
}</pre>
</div>
<h4 id="lemonldapng">LemonLDAP::NG</h4>
<div class="level4">
<p>
Edit <code>lemonldap-ng.ini</code>, and activate status in the <code>handler</code> section:
</p>
<pre class="code file ini"><span class="re0"><span class="br0">&#91;</span>handler<span class="br0">&#93;</span></span>
# Set status to <span class="nu0">1</span> if you want to have the report of activity <span class="br0">&#40;</span>used for
# example to inform MRTG<span class="br0">&#41;</span>
<span class="re1">status</span> <span class="sy0">=</span><span class="re2"> 1</span></pre>
<p>
Then restart webserver.
</p>
</div>
<!-- EDIT6 SECTION "Configuration" [1778-] --></div>
</body>
</html>