<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Hi Magnus,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Thanks for your help.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">I will test these settings as soon as possible and I will give you feedback.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Aurélien<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:FR">De :</span></b><span style="color:windowtext;mso-fareast-language:FR"> Naemon-users [mailto:naemon-users-bounces+aurelien.clavier=pentasonic.net@monitoring-lists.org]
<b>De la part de</b> Magnus<br>
<b>Envoyé :</b> mardi 16 juin 2015 21:48<br>
<b>À :</b> naemon-users@monitoring-lists.org<br>
<b>Objet :</b> Re: [naemon-users] [NAEMON] : Authentication on Naemon - Nagvis - Nagvis - Pnp4nagios<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hello,<br>
<br>
I have this ldap configuration. You have to enable the authnz_ldap and perhaps the ldap module of apache with a2enmod also.<br>
<br>
I wouldn't call this SSO since that would be using your windows workstation or linux workstation credentials but you will only need to login one time for all naemon/pnp4nagios pages as you already have experienced.<br>
<br>
I am going on holiday for a week so if you have any follow up questions it will take a while before I reply. :)<br>
<br>
<Location /thruk><br>
Options ExecCGI<br>
AuthName "Nagios Access"<br>
AuthType Basic<br>
AuthBasicProvider ldap<br>
<br>
AuthLDAPURL "<a href="ldap://">ldap://</a><IPOFDC1> <IPOFDC2>/DC=<XXXX>,DC=local?sAMAccountName?sub"<br>
AuthLDAPGroupAttribute member<br>
AuthLDAPGroupAttributeIsDN on<br>
AuthLDAPBindDN <ad-account>@<domain><br>
AuthLDAPBindPassword <PASSWORD><br>
#AuthLDAPSubGroupDepth 3<br>
require ldap-group CN=Grp.Users.Nagios,OU=_Groups,DC=XXXX,DC=local<br>
#require valid-user<br>
<br>
</Location><br>
<br>
Regards<br>
Magnus<br>
<br>
On 2015-06-16 10:04, Aurélien CLAVIER wrote:<span style="font-size:12.0pt;mso-fareast-language:FR"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Bonjour,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Thank you Magnus ;) I solved my problem !!!!!! I’m also interested in to know how you enabled Active Directory auth and basic auth in same time, can you explain me how to ?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Under, this is the solution to enable SSO with basic auth on Naemon 1.0.3 (on httpd server) :</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">In fact, when you installed Naemon, Thruk make an Apache configuration’s file which is thruk_cookie_auth_vhost.conf with these settings :</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># thruk_cookie_auth_vhost.conf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">RewriteEngine On</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><IfModule !mod_authz_core.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteLock "/var/cache/naemon/thruk/apache_rewrite.lock"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><VirtualHost *:80></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # extend default virtual host. put/include these rewrite rules in https or</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # any other virtual host if you want to enable cookie authentication</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Include /usr/share/naemon/thruk_cookie_auth.include</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></VirtualHost></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><b><u><span style="color:#2E74B5;mso-fareast-language:FR">When I renamed this file with thruk_cookie_auth_vhost.conf.OLD and then restart my HTTPD server, I have been prompted only ONE TIME for all components (Naemon, Thruk, Nagvis and
PNP4Nagios). So this solved my problem.</span></u></b><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">For more details, these are my apache configuration files :</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># thruk.conf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><IfModule mod_fcgid.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AddHandler fcgid-script .sh</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> IPCCommTimeout 120</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Directory /usr/share/naemon></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AllowOverride All</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> order allow,deny</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # required for apache 2.4</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <IfModule mod_authz_core.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require all granted</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Directory></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Directory /etc/naemon/themes></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # required for apache 2.4</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <IfModule mod_authz_core.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require all granted</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Directory></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Directory /etc/naemon/plugins></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # required for apache 2.4</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <IfModule mod_authz_core.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require all granted</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Directory></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Alias /naemon/documentation.html /usr/share/naemon/root/thruk/documentation.html</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Alias /naemon/startup.html /usr/share/naemon/root/thruk/startup.html</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AliasMatch ^/naemon/(.*\.cgi|.*\.html) /usr/share/naemon/fcgid_env.sh/naemon/$1</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AliasMatch ^/naemon/plugins/(.*?)/(.*)$ /etc/naemon/plugins/plugins-enabled/$1/root/$2</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Alias /naemon/themes/ /etc/naemon/themes/themes-enabled/</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Alias /naemon/ /usr/share/naemon/root/thruk/</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Location /naemon/></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options ExecCGI FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthName "Naemon Monitoring"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthType Basic</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthUserFile /etc/naemon/htpasswd</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require valid-user</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Location></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Location /naemon/cgi-bin/remote.cgi></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Order Deny,Allow</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Satisfy any</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Location></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># use compressed output if available</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><IfModule mod_deflate.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <Location /naemon/></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </Location></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></IfModule></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># nagvis.conf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># NagVis Apache2 sample configuration file</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># #############################################################################</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Alias /nagvis "/etc/nagvis/share"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><Directory "/etc/nagvis/share"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AllowOverride None</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Order allow,deny</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # To enable Nagios basic auth on NagVis use the following options</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Just uncomment it. Maybe you need to adjust the path to the</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Auth user file.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # If you use the NagVis internal auth mechanism based on the web</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # for you won't need this.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># AuthName "Naemon Access"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># AuthType Basic</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># AuthUserFile /etc/naemon/htpasswd</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># Require valid-user</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options ExecCGI FollowSymLinks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthName "Naemon Monitoring"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthType Basic</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthUserFile /etc/naemon/htpasswd</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require valid-user</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # With installed and enabled mod_rewrite there are several redirections</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # available to fix deprecated and/or wrong urls. None of those rules is</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # mandatory to get NagVis working.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <IfModule mod_rewrite.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteEngine On</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteBase /nagvis</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Use mod_rewrite for old url redirection even if there are php files which</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # redirect the queries itselfs. In some cases the mod_rewrite redirect</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # is better than the php redirect.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Using the php redirect seems to be better in some cases where https/http servers</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # are mixed. For example in OMD setups where using apache own mode and https in the</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # frontend and http in the backend apache servers.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Disabling this redirect by default in the hope that the php direct works better.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #RewriteCond %{REQUEST_URI} ^/nagvis(/config\.php|/index\.php|/|)(\?.*|)$</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/%1%2 [R=301,L]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Redirect old regular map links</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{REQUEST_URI} ^/nagvis/frontend/(wui|nagvis-js)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{QUERY_STRING} map=(.*)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=%1 [R=301,L]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Without map= param</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{REQUEST_URI} ^/nagvis/frontend(/wui)?/?(index.php)?$</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php [R=301,L]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Redirect old rotation calls</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{REQUEST_URI} ^/nagvis/frontend/nagvis-js</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{QUERY_STRING} !mod</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond %{QUERY_STRING} rotation=(.*)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php?mod=Rotation&act=view&show=%1 [R=301,L]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></Directory></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"># pnp4nagios.conf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR">Alias /pnp4nagios "/usr/local/pnp4nagios/share"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"><Directory "/usr/local/pnp4nagios/share"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AllowOverride None</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Order allow,deny</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Allow from all</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Use the same value as defined in nagios.conf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> #</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthName "Naemon Monitoring"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthType Basic</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> AuthUserFile /etc/naemon/htpasswd</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Require valid-user</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> <IfModule mod_rewrite.c></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Turn on URL rewriting</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteEngine On</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> Options symLinksIfOwnerMatch</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Installation directory</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteBase /pnp4nagios/</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Protect application and system files from being viewed</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteRule "^(?:application|modules|system)/" - [F]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Allow any files or directories that exist to be displayed directly</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond "%{REQUEST_FILENAME}" !-f</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteCond "%{REQUEST_FILENAME}" !-d</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> # Rewrite all other URLs to index.php/URL</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> RewriteRule "^.*$" "index.php/$0" [PT]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </IfModule></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"></Directory></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#2E74B5;mso-fareast-language:FR"> </span><o:p></o:p></p>
</div>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:FR">De :</span></b><span style="color:windowtext;mso-fareast-language:FR"> Naemon-users [<a href="mailto:naemon-users-bounces+aurelien.clavier=pentasonic.net@monitoring-lists.org">mailto:naemon-users-bounces+aurelien.clavier=pentasonic.net@monitoring-lists.org</a>]<b>De
la part de</b> Magnus<br>
<b>Envoyé :</b> lundi 15 juin 2015 22:25<br>
<b>À :</b> <a href="mailto:naemon-users@monitoring-lists.org">naemon-users@monitoring-lists.org</a><br>
<b>Objet :</b> Re: [naemon-users] [NAEMON] : Authentication on Naemon - Nagvis - Nagvis - Pnp4nagios</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Hello,<br>
<br>
If you have your users in a file (like this line in apache config AuthUserFile /etc/nagios3/htpasswd.users) then just make sure the config file for pnp44nagios and so on use the same file.<br>
<br>
Personally I connect them to and active directory ldap tree so then they are also the same.<br>
<br>
If you use the same AuthName in all the apache config files you wont be prompted for each either.<br>
<br>
Regards<br>
Magnus<br>
<br>
On 2015-06-15 14:54, Aurélien CLAVIER wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">Hi all,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">I installed Naemon since 2 weeks in a fesh Centos 7. I installed Nagvis and PNP4nagios wich run like a charm.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">But I have a problem with basic authentication of Naemon, Thruk, PNP4nagios and Nagvis. In fact, I want to PNP4nagios and Nagvis use same credentials that Naemon/Thruk is using.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">How to do this ?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">Thanks in advance</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR">Aurélien</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR"><o:p> </o:p></span></p>
</div>
</body>
</html>