Getting 403 errors at login

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.
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Getting 403 errors at login

Post by corrinmana »

So installed Nagios using the Fedora quickstart guide. Preflight check OK. But when I try to log in I get a 403 permission denied error. I looked at answers to the problem other people posted, but the answers all revolved around adding an index.html file to the Apache/httpd folder and I already have one in there. I only get the message when I have the correct username/password, getting it wrong gives me the prompt 'authentication failed, would you like to try again y/n?'

I'm running the webserver on an EC2 instance (T1 micro) and using the Amazon-linux that comes with it. My understanding is that Amazon-linux is most like CentOS.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Getting 403 errors at login

Post by sreinhardt »

Let's check a few things.

Code: Select all

grep -i 'nag' /etc/group
ls -lv /usr/local/nagios/sbin
ls -lv /usr/local/nagios/share
tail -n 20 /usr/local/nagios/var/nagios.log
tail -n 20 /var/log/messages
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Re: Getting 403 errors at login

Post by corrinmana »

>grep -i 'nag' /etc/group

nagios:x:501:nagios
nagcmd:x:502:nagios,apache

>ls -lv /usr/local/nagios/sbin

-rwxrwxr-x 1 nagios nagios 244832 Sep 5 19:24 avail.cgi
-rwxrwxr-x 1 nagios nagios 239352 Sep 5 19:24 cmd.cgi
-rwxrwxr-x 1 nagios nagios 211992 Sep 5 19:24 config.cgi
-rwxrwxr-x 1 nagios nagios 252992 Sep 5 19:24 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 208152 Sep 5 19:24 histogram.cgi
-rwxrwxr-x 1 nagios nagios 187464 Sep 5 19:24 history.cgi
-rwxrwxr-x 1 nagios nagios 183344 Sep 5 19:24 notifications.cgi
-rwxrwxr-x 1 nagios nagios 179216 Sep 5 19:24 outages.cgi
-rwxrwxr-x 1 nagios nagios 179728 Sep 5 19:24 showlog.cgi
-rwxrwxr-x 1 nagios nagios 244992 Sep 5 19:24 status.cgi
-rwxrwxr-x 1 nagios nagios 204128 Sep 5 19:24 statusmap.cgi
-rwxrwxr-x 1 nagios nagios 199776 Sep 5 19:24 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 183376 Sep 5 19:24 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 204480 Sep 5 19:24 summary.cgi
-rwxrwxr-x 1 nagios nagios 195688 Sep 5 19:24 tac.cgi
-rwxrwxr-x 1 nagios nagios 212256 Sep 5 19:24 trends.cgi

>ls -lv /usr/local/nagios/share

-rw-rw-r-- 1 nagios nagios 576 Sep 5 19:24 config.inc.php
drwxrwxr-x 2 nagios nagios 4096 Sep 5 19:24 contexthelp
drwxrwxr-x 3 nagios nagios 4096 Sep 5 19:24 docs
drwxrwxr-x 3 nagios nagios 4096 Sep 5 19:24 images
drwxrwxr-x 2 nagios nagios 4096 Sep 5 19:24 includes
-rw-rw-r-- 1 nagios nagios 1440 Sep 5 19:24 index.php
drwxr-xr-x 4 root root 4096 Sep 5 19:37 locale
-rw-rw-r-- 1 nagios nagios 3440 Sep 5 19:24 main.php
drwxrwxr-x 2 nagios nagios 4096 Sep 5 19:24 media
-rw-rw-r-- 1 nagios nagios 26 Sep 5 19:24 robots.txt
-rw-rw-r-- 1 nagios nagios 5714 Sep 5 19:24 side.php
drwxrwxr-x 2 nagios nagios 4096 Sep 5 19:24 ssi
drwxrwxr-x 2 nagios nagios 4096 Sep 5 19:24 stylesheets

>tail -n 20 /usr/local/nagios/var/nagios.log

[1378824422] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378824422] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 14:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378825782] Auto-save of retention data completed successfully.
[1378828022] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378828022] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 15:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378829382] Auto-save of retention data completed successfully.
[1378831622] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378831622] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 16:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378832982] Auto-save of retention data completed successfully.
[1378835222] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378835222] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 17:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378836582] Auto-save of retention data completed successfully.
[1378838822] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378838822] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 18:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378840182] Auto-save of retention data completed successfully.
[1378842422] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378842422] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 19:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
[1378843782] Auto-save of retention data completed successfully.
[1378846022] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378846022] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 20:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

>tail -n 20 /var/log/messages

Sep 10 14:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 14:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 15:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 15:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 15:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 15:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 16:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 16:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 16:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 16:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 17:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 17:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 17:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 17:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 18:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 18:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 18:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 18:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 19:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 19:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 19:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 19:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 20:09:42 ip-10-224-12-200 nagios: Auto-save of retention data completed successfully.
Sep 10 20:47:02 ip-10-224-12-200 nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Sep 10 20:47:02 ip-10-224-12-200 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 20:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Sep 10 20:50:06 ip-10-224-12-200 auditd[1049]: Audit daemon rotating log files

#not sure if it's relevant, but I had to do the last command as the root user.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Getting 403 errors at login

Post by abrist »

corrinmana wrote:>grep -i 'nag' /etc/group

nagios:x:501:nagios
nagcmd:x:502:nagios,apache
Add apache to the nagios group:

Code: Select all

usermod -a -G nagios apache
Restart nagios:
service nagios restart
corrinmana wrote:[1378824422] SERVICE NOTIFICATION: nagiosadmin;localhost;Swap Usage;CRITICAL;notify-service-by-email;SWAP CRITICAL - 100% free (0 MB out of 0 MB)
[1378824422] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: Swap Usage\nHost: localhost\nAddress: 127.0.0.1\nState: CRITICAL\n\nDate/Time: Tue Sept 10 14:47:02 UTC 2013\n\nAdditional Info:\n\nSWAP CRITICAL - 100% free (0 MB out of 0 MB)\n" | /bin/mail -s "** PROBLEM Service Alert: localhost/Swap Usage is CRITICAL **" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Does /bin/mail exist?

Code: Select all

which mail
How about /usr/bin/printf?

Code: Select all

which printf
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.
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Re: Getting 403 errors at login

Post by corrinmana »

printf exists, but mail does not.
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Re: Getting 403 errors at login

Post by corrinmana »

Should note that adding Apche to the nagios group and restarting did not solve the issue.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Getting 403 errors at login

Post by lmiltchev »

Try to log in again, then run the following command and show the output:

Code: Select all

tail 30 /var/log/httpd/error_log
Be sure to check out our Knowledgebase for helpful articles and solutions!
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Re: Getting 403 errors at login

Post by corrinmana »

tail: cannot open `30' for reading: No such file or directory
==> /var/log/httpd/error_log <==
[Tue Sep 10 22:50:17 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Sep 10 22:50:17 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Sep 10 22:50:17 2013] [notice] Digest: done
[Tue Sep 10 22:50:17 2013] [notice] Apache/2.2.25 (Unix) DAV/2 configured -- resuming normal operations
[Tue Sep 10 22:50:49 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /usr/local/nagios/share/
[Wed Sep 11 14:45:12 2013] [error] [client 66.249.74.81] File does not exist: /var/www/html/robots.txt
[Thu Sep 12 10:24:03 2013] [error] [client 192.74.250.99] File does not exist: /var/www/html/manager
[Thu Sep 12 17:58:23 2013] [error] [client 94.102.48.168] File does not exist: /var/www/html/headers
[Thu Sep 12 21:29:13 2013] [error] [client 192.96.204.42] File does not exist: /var/www/html/robots.txt
[Thu Sep 12 23:30:45 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /usr/local/nagios/share/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Getting 403 errors at login

Post by scottwilkerson »

Do you have php installed in your system?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
corrinmana
Posts: 7
Joined: Sun Sep 08, 2013 3:35 pm

Re: Getting 403 errors at login

Post by corrinmana »

No
Locked