Logged in as ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Logged in as ?

Post by moetteli »

Hello,


Nagios seems to work flawlessly, but since some time, I always have "Logged in as ?" in the upper left corner.
I don't remember, what I changed, when this behavior started to show.
I googled all over the net and the common solution seems to be to add a .htaccess into the cgi-bin directory:

Code: Select all

/usr/lib/cgi-bin/nagios3# cat .htaccess 
<Directory "/usr/lib/cgi-bin/nagios3">
	AuthName "Nagios Access"
	AuthType Basic
	AuthUserFile /etc/nagios3/htpasswd.users
	require valid-user
</Directory>
Unfortunately, this doesn't change anything. Probably because there was already a directoryMatch for this directory with the same values in it. And now, I don't have any idea, what I could try.
How could I debug the problem?


Btw, the most important CGI values:

Code: Select all

#default_user_name=guest
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
authorized_for_read_only=test
use_authentication=0
use_ssl_authentication=1
Yes, I connect over HTTPS (443). But even over HTTP (80), it doesn't work.


Thanks for any help
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Logged in as ?

Post by abrist »

Are you logging in as "nagiosadmin"?
Just to be sure, clear the browser cache and re-login. Do you still see the issue?
If so, what are the permissions on the cgis?

Code: Select all

ls -la /usr/local/nagios/sbin/
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Re: Logged in as ?

Post by moetteli »

Hello,

Are you logging in as "nagiosadmin"?
Yes.
Just to be sure, clear the browser cache and re-login.
I haven't saved login credits. I quit Firefox and log in again. Usually, I switch between my user and a user 'test'.
Do you still see the issue?
Yes.
If so, what are the permissions on the cgis?

Code: Select all

# ls -alg /usr/lib/cgi-bin/nagios3/*
-rwxr-xr-x 1 root 288856 Jan  9  2014 /usr/lib/cgi-bin/nagios3/avail.cgi
-rwxr-xr-x 1 root 287416 Jan  9  2014 /usr/lib/cgi-bin/nagios3/cmd.cgi
-rwxr-xr-x 1 root 256000 Jan  9  2014 /usr/lib/cgi-bin/nagios3/config.cgi
-rwxr-xr-x 1 root 301104 Jan  9  2014 /usr/lib/cgi-bin/nagios3/extinfo.cgi
-rwxr-xr-x 1 root 251992 Jan  9  2014 /usr/lib/cgi-bin/nagios3/histogram.cgi
-rwxr-xr-x 1 root 227376 Jan  9  2014 /usr/lib/cgi-bin/nagios3/history.cgi
-rwxr-xr-x 1 root 227376 Jan  9  2014 /usr/lib/cgi-bin/nagios3/notifications.cgi
-rwxr-xr-x 1 root 223240 Jan  9  2014 /usr/lib/cgi-bin/nagios3/outages.cgi
-rwxr-xr-x 1 root 223248 Jan  9  2014 /usr/lib/cgi-bin/nagios3/showlog.cgi
-rwxr-xr-x 1 root 301112 Jan  9  2014 /usr/lib/cgi-bin/nagios3/status.cgi
-rwxr-xr-x 1 root 247872 Jan  9  2014 /usr/lib/cgi-bin/nagios3/statusmap.cgi
-rwxr-xr-x 1 root 243760 Jan  9  2014 /usr/lib/cgi-bin/nagios3/statuswml.cgi
-rwxr-xr-x 1 root 227376 Jan  9  2014 /usr/lib/cgi-bin/nagios3/statuswrl.cgi
-rwxr-xr-x 1 root 247904 Jan  9  2014 /usr/lib/cgi-bin/nagios3/summary.cgi
-rwxr-xr-x 1 root 239704 Jan  9  2014 /usr/lib/cgi-bin/nagios3/tac.cgi
-rwxr-xr-x 1 root 256096 Jan  9  2014 /usr/lib/cgi-bin/nagios3/trends.cgi

Thanks
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Logged in as ?

Post by lmiltchev »

Do you see any clues in the logs ("/var/log/syslog" and "/var/log/apache2/error.log")?

Is "nagiosadmin" present in the "/etc/nagios3/htpasswd.users"?

Code: Select all

grep nagiosadmin /etc/nagios3/htpasswd.users
Is selinux enabled?

Code: Select all

sestatus
Run the following command and show us the output:

Code: Select all

grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Re: Logged in as ?

Post by moetteli »

Do you see any clues in the logs ("/var/log/syslog" and "/var/log/apache2/error.log")?


Nothing: Not one line is added, when I log in.
Is "nagiosadmin" present in the "/etc/nagios3/htpasswd.users"?

Code: Select all

# grep nagiosadmin /etc/nagios3/htpasswd.users
nagiosadmin:$apr1$C2B[…]U2oW1tua1
Is selinux enabled?

Code: Select all

# sestatus
SELinux status:                 disabled
Run the following command and show us the output:

Code: Select all

# grep nag /etc/group
nagios:x:120:nagios,www-data,root,shinken
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Logged in as ?

Post by lmiltchev »

I don't see an entry for "nagcmd"... Normally, you would have:

Code: Select all

nagios:x:xxx:nagios,www-data
nagcmd:x:xxx:nagios,www-data
Just want to point out that this is a nagios support forum... (shinken is not supported).
Be sure to check out our Knowledgebase for helpful articles and solutions!
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Re: Logged in as ?

Post by moetteli »

Just want to point out that this is a nags support forum... (shinken is not supported).
I don't have Shinken and I don't intend to use it. I just installed the Nagios Ubuntu packages. I don't know, who created this user.
I will try to find out now about this 'nagcmd'…
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Re: Logged in as ?

Post by moetteli »

moetteli wrote:I will try to find out now about this 'nagcmd'…
Could somebody do a

Code: Select all

find /usr /var /etc -group nagcmd
and tell me what directories are filled with files owned by that group? Or tell me otherwise, what files and directories I have to change to that group?
Or what else, I could do?

Thanks
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Logged in as ?

Post by Box293 »

Here's the output of that command:

Code: Select all

/usr/local/nagios/var/spool/checkresults
/usr/local/nagios/var/rw
/usr/local/nagios/var/rw/nagios.cmd
/usr/local/nagios/var/rw/nagios.qh

(this was from an XI server)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
moetteli
Posts: 13
Joined: Wed Aug 28, 2013 2:23 am

Re: Logged in as ?

Post by moetteli »

I created the group:

Code: Select all

# members nagcmd
nagios www-data
I have changed the files, which were mentioned by one friendly fore-poster:

Code: Select all

# find /usr /var /etc -group nagcmd
/var/lib/nagios3/spool
/var/lib/nagios3/spool/checkresults
/var/lib/nagios3/spool/checkresults/checkKVlPhZ
/var/lib/nagios3/rw
/var/lib/nagios3/rw/nagios.cmd
/var/lib/nagios3/rw/live
Unfortunately, nothing has changed. I'm still anonymous "?".
Please, does anybody have any other idea?


Thanks
Locked