Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:latest:status [2019/01/15 15:54] (current)
Line 1: Line 1:
 +====== Status pages ======
 +
 +===== Portal Status (experimental) =====
 +
 +The portal displays in JSON format its activity. Some d This can give a view to all returned codes.
 +
 +==== Configuration ====
 +
 +*  Set ''​portalStatus = 1''​ in lemonldap-ng.ini file (section ''​[Portal]''​)
 +*  Note that handler status must also been enabled
 +*  Protect http://​portal/​portalStatus using your webserver configuration
 +
 +Status is displayed by calling this URL.
 +
 +===== Handler Status =====
 +
 +==== Presentation ====
 +
 +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.
 +
 +<note tip>
 +This page can be browsed for example by [[http://​oss.oetiker.ch/​mrtg/​|MRTG]] using the [[mrtg|MRTG monitoring script]].
 +</​note>​
 +
 +The statistics are collected trough a daemon launched by the Handler. It can be seen in system processes.
 +
 +Statistics are displayed when calling the status path on an Handler (for example: http://​reload.example.com/​status).
 +
 +Example of status page:
 +
 +{{ :​documentation:​status_standard.png |}}
 +
 +==== Configuration ====
 +
 +=== Nginx ===
 +
 +You need to give access to status path in the Handler Nginx configuration:​
 +<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;
 +  }
 +}
 +</​file>​
 +
 +=== Apache ===
 +
 +You need to give access to status path in the Handler Apache configuration:​
 +
 +<file apache>
 +    # Uncomment this to activate status module
 +    <​Location /status>
 +        Order deny,allow
 +        Allow from 127.0.0.0/8
 +        PerlHeaderParserHandler Lemonldap::​NG::​Handler->​status
 +    </​Location>​
 +</​file>​
 +
 +Then restart Apache.
 +
 +<note tip>You should change the ''​Allow''​ directive to match administration IP, or use another Apache protection mean.</​note>​
 +
 +== Portal data ==
 +
 +By default Apache handler status process listen to ''​localhost:​64321''​ //(UDP)//. You can change this using ''​LLNGSTATUSLISTEN''​ environment variable. If you want to collect portal data, you just have to set ''​LLNGSTATUSHOST''​ environment variable //(see comments in our ''​portal-apache2.conf''​)//​.
 +
 +<code apache>
 +  <Files *.fcgi>
 +    SetHandler fcgid-script
 +    # For Authorization header to be passed, please uncomment one of the following:
 +    # for Apache >= 2.4.13
 +    #​CGIPassAuth On
 +    # for Apache < 2.4.13
 +    #​RewriteCond %{HTTP:​Authorization} ^(.*)
 +    #​RewriteRule .* - [e=HTTP_AUTHORIZATION:​%1]
 +    Options +ExecCGI
 +    header unset Lm-Remote-User
 +  </​Files>​
 +  FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:​64321
 +</​code>​
 +
 +=== LemonLDAP::​NG ===
 +
 +Edit ''​lemonldap-ng.ini'',​ and activate status in the ''​handler''​ section:
 +
 +<file ini>
 +[all]
 +# Set status to 1 if you want to have the report of activity (used for
 +# example to inform MRTG)
 +status = 1
 +</​file>​
 +
 +Then restart webserver.
 +
 +==== Advanced ====
 +
 +  - You can also open the UDP port with Nginx if you set ''​LLNGSTATUSLISTEN''​ environment variable //​(host:​port)//​
 +  - When querying status //(using portal or handler status)// and if UDP is used, query is given to ''​LLNGSTATUSHOST''​ //​(host:​port)//​ and response is waiting on a dynamic UDP port given in query //(between 64322 and 64331)//. By default this dynamic UDP port is opened on loopback //​(''​localhost''​ entry in ''/​etc/​hosts''​)//​. To change this, set an IP address or a host using ''​LLNGSTATUSCLIENT''​ environment variable.