Page 1 of 2

Getting 403 errors at login

Posted: Sun Sep 08, 2013 3:54 pm
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.

Re: Getting 403 errors at login

Posted: Mon Sep 09, 2013 2:15 pm
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

Re: Getting 403 errors at login

Posted: Tue Sep 10, 2013 3:56 pm
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.

Re: Getting 403 errors at login

Posted: Tue Sep 10, 2013 4:43 pm
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

Re: Getting 403 errors at login

Posted: Tue Sep 10, 2013 5:23 pm
by corrinmana
printf exists, but mail does not.

Re: Getting 403 errors at login

Posted: Tue Sep 10, 2013 5:50 pm
by corrinmana
Should note that adding Apche to the nagios group and restarting did not solve the issue.

Re: Getting 403 errors at login

Posted: Wed Sep 11, 2013 10:31 am
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

Re: Getting 403 errors at login

Posted: Thu Sep 12, 2013 6:32 pm
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/

Re: Getting 403 errors at login

Posted: Thu Sep 12, 2013 8:36 pm
by scottwilkerson
Do you have php installed in your system?

Re: Getting 403 errors at login

Posted: Fri Sep 13, 2013 2:40 pm
by corrinmana
No