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.
* Set portalStatus = 1
in lemonldap-ng.ini file (section [Portal]
)
* Protect http://portal/portalStatus using your webserver configuration
Status is displayed by calling this URL.
Lorsque la fonctionnalité "status" est activée, les agents et le portail collectent des statistiques et les sauvegardent dans le cache local Donc si plusieurs agents sont déployés, chacun gère ses propres statistiques.
Ces statistiques sont collectées via un démon lancé par l'agent. Il peut être vu dans les processus du système, par exemple :
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 &Lemonldap::NG::Handler::Status::run(Cache::FileCache,{? 'cache_depth' => 5,? 'cache_root' => '/tmp',? 'directory_umask' => '007',? 'default_expires_in' => 600,? 'namespace' => 'MyNamespace'? }?);
Les statistiques sont affichées lors des appels au chemin du statut sur un agent (par exemple : http://test1.example.com/status).
Exemple de page de statut :
Il faut autoriser l'accès au chemin du statut dans le configuration Apache de l'agent :
# Uncomment this to activate status module <Location /status> Order deny,allow Allow from 127.0.0.0/8 PerlHeaderParserHandler Lemonldap::NG::Handler->status </Location>
Redémarrer Apache ensuite.
Allow
pour réserver l'adresse IP d'administration, ou utiliser une autre protection.
You need to give access to status path in the Handler Nginx configuration:
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; } }
Éditer lemonldap-ng.ini
, et activer le statut dans la section handler
:
[handler] # Set status to 1 if you want to have the report of activity (used for # example to inform MRTG) status = 1
Then restart webserver.