404 Not Found

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.
arkonpl
Posts: 10
Joined: Tue Aug 02, 2016 8:31 am

Re: 404 Not Found

Post by arkonpl »

Hello,
Here is output for your commands:

Code: Select all

[root@host local]# ls -ld /usr/local
drwxr-xr-x. 14 root root 4096 Jul 29 15:01 /usr/local
[root@host local]# ls -ld /usr/local/nagiosgraph
drwxrwxr-x 10 nagios nagios 94 Jul 29 15:01 /usr/local/nagiosgraph
[root@host local]# ls -l /usr/local/nagiosgraph
total 12
drwxrwxr-x 2 nagios nagios   22 Aug 19 10:29 bin
drwxrwxr-x 2 nagios nagios 4096 Aug 19 10:29 cgi
drwxrwxr-x 2 nagios nagios   74 Jul 29 15:01 doc
drwxrwxr-x 2 nagios nagios 4096 Aug 19 10:29 etc
drwxrwxr-x 2 nagios nagios 4096 Jul 29 15:01 examples
drwxrwxr-x 2 nagios nagios   86 Aug 19 10:29 share
drwxrwxr-x 2 nagios nagios   44 Jul 29 15:01 util
drwxrwxr-x 4 nagios nagios   26 Jul 29 15:01 var
[root@host local]# ls -l /usr/local/nagiosgraph/cgi
total 68
-rwxr-xr-x 1 nagios nagios  6984 Aug 19 10:29 export.cgi
-rwxr-xr-x 1 nagios nagios  4951 Aug 19 10:29 show.cgi
-rwxr-xr-x 1 nagios nagios 12051 Aug 19 10:29 showconfig.cgi
-rwxr-xr-x 1 nagios nagios  5204 Aug 19 10:29 showgraph.cgi
-rwxr-xr-x 1 nagios nagios  5022 Aug 19 10:29 showgroup.cgi
-rwxr-xr-x 1 nagios nagios  4946 Aug 19 10:29 showhost.cgi
-rwxr-xr-x 1 nagios nagios  4978 Aug 19 10:29 showservice.cgi
-rwxr-xr-x 1 nagios nagios  5303 Aug 19 10:29 testcolor.cgi
Last edited by tmcdonald on Mon Aug 22, 2016 10:00 am, edited 1 time in total.
Reason: Please use [code][/code] tags around terminal output
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: 404 Not Found

Post by ssax »

What is the output of these commands:

Code: Select all

chage -l nagios
grep nag /etc/group
grep "User \|Group " /etc/httpd/conf/httpd.conf
Thank you
arkonpl
Posts: 10
Joined: Tue Aug 02, 2016 8:31 am

Re: 404 Not Found

Post by arkonpl »

Here are outputs:

Code: Select all

[root@host local]# chage -l nagios
Last password change                                    : Jul 27, 2016
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
[root@host local]# grep nag /etc/group
nagios:x:2035:apache
[root@host local]# grep "User \|Group " /etc/httpd/conf/httpd.conf
User apache
Group apache
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: 404 Not Found

Post by tmcdonald »

Can you also post/PM the things that @ssax asked for in a previous posting?
ssax wrote:Also, please attach your /etc/httpd/conf/httpd.conf file and your entire /etc/httpd/conf.d/ directory
Honestly at this point though I almost have to recommend posting on the Nagiosgraph forum:

https://sourceforge.net/p/nagiosgraph/discussion/394748

Since this is not our product and we do not officially support it.
Former Nagios employee
arkonpl
Posts: 10
Joined: Tue Aug 02, 2016 8:31 am

Re: 404 Not Found

Post by arkonpl »

I will post on nagiosgraph forum today or tommorow with link to this forum, plus all files and my instalation process. Here are all files (exclude README) from /etc/httpd/conf.d/

autoindex.conf

Code: Select all

#
# Directives controlling the display of server-generated directory listings.
#
# Required modules: mod_authz_core, mod_authz_host,
#                   mod_autoindex, mod_alias
#
# To see the listing of a directory, the Options directive for the
# directory must include "Indexes", and the directory must not contain
# a file matching those listed in the DirectoryIndex directive.
#

#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing HTMLTable VersionSort

# We include the /icons/ alias for FancyIndexed directory listings.  If
# you do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/httpd/icons/"

<Directory "/usr/share/httpd/icons">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride None
    Require all granted
</Directory>

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions.  These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif /core
AddIcon /icons/bomb.gif */core.*

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes.  These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README.html
HeaderName HEADER.html

#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing.  Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

nagios.conf

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>
nagiosgraph.conf

Code: Select all

# enable nagiosgraph CGI scripts
ScriptAlias /nagiosgraph/cgi "/usr/local/nagiosgraph/cgi"
<Directory "/usr/local/nagiosgraph/cgi">
Options ExecCGI
AllowOverride None
Require all granted
</Directory>
# enable nagiosgraph CSS and JavaScript
Alias /nagiosgraph "/usr/local/nagiosgraph/share"
<Directory "/usr/local/nagiosgraph/share">
Options None
AllowOverride None
Require all granted
</Directory>
php.conf

Code: Select all

#
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

#
# Allow php to handle Multiviews
#
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
#    SetHandler application/x-httpd-php-source
#</FilesMatch>

#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path    "/var/lib/php/session"
userdir.conf

Code: Select all

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    #UserDir public_html
</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>

welcome.conf

Code: Select all

#
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL.  To disable the
# Welcome page, comment out all the lines below.
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /.noindex.html
</LocationMatch>

<Directory /usr/share/httpd/noindex>
    AllowOverride None
    Require all granted
</Directory>

Alias /.noindex.html /usr/share/httpd/noindex/index.html
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 404 Not Found

Post by tgriep »

Another idea is to check the config files and see if the paths are correct there.
They should be in this folder by default.

Code: Select all

/etc/nagiosgraph
Be sure to check out our Knowledgebase for helpful articles and solutions!
arkonpl
Posts: 10
Joined: Tue Aug 02, 2016 8:31 am

Re: 404 Not Found

Post by arkonpl »

Only nagiosgraph directory that I have is in /usr/local/ and I posted all config files here. I also wrote on nagiosgraph forum, but there is nobody who can answer.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 404 Not Found

Post by tgriep »

If you are still seeing this error in the Apache error logs

Code: Select all

[authz_core:error] [pid 6836] [client IP:62119] AH01630: client denied by server configuration: /usr/local/nagiosgraph/share/cgi-bin
Create that folder, copy the cgi's to it and set the permissions and see if it works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
arkonpl
Posts: 10
Joined: Tue Aug 02, 2016 8:31 am

Re: 404 Not Found

Post by arkonpl »

I think you just solved my problem. Now, when I click on the link to nagiosgraph it shows me show.cgi in my browser. This could be, because I don't have connection at the moment to my servers via nagios host.

Thank you very much Nagios Supporters for any help you provided and for solving even not your own plugin product problem! :D

P.S. I will write tl;dr in first post, so someone with the same problem can solve it faster :)
sankey
Posts: 2
Joined: Thu Oct 20, 2016 4:40 am

Re: 404 Not Found

Post by sankey »

I did the same thing as you said but still getting the same error.
The requested URL /nagiosgraph/cgi-bin/show.cgi was not found on this server.

please help me to resolve this issue...
Thanks in advance.
Locked