Can't acces Nagios web interface

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.
Yurian00
Posts: 13
Joined: Mon Dec 09, 2013 5:53 am

Can't acces Nagios web interface

Post by Yurian00 »

Hello everybody:

First, sorry for my english, I hope not to kick the english dictionary too far :P.

Ok, focus on the problem.

This is the first time that I try to install Nagios Core. I'm using CentOS 6.5. I have followed this guide step by step with no errors to install Nagios Core on the server: http://assets.nagios.com/downloads/nagi ... Source.pdf

I've checked the firewall rules and logs in the firewall and the connection is established correctly but I only obtain a timeout when I try to acces the Nagios web interface "http://xxx.xxx.xxx.xxx/nagios". To make sure I allow a full IP acces against the Nagios server but I still obtaining the same results.

Any Idea?

If you need further information just let me know and I'll try to privide it to you.


Thank you very much in advance for your help!!!!!!

Kind regards.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Can't acces Nagios web interface

Post by slansing »

Please show the output of the following:

Code: Select all

service httpd status

sestatus
Yurian00
Posts: 13
Joined: Mon Dec 09, 2013 5:53 am

Re: Can't acces Nagios web interface

Post by Yurian00 »

service httpd status
httpd (pid 1723) is running

sestatus:

SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: permissive
Policy version: 24
Policy from config file: targeted
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't acces Nagios web interface

Post by abrist »

Did you run "make install-webconf"? Is the apache vhost config present:

Code: Select all

cat /etc/httpd/conf.d/nagios
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.
Yurian00
Posts: 13
Joined: Mon Dec 09, 2013 5:53 am

Re: Can't acces Nagios web interface

Post by Yurian00 »

It says "No such file or directory" when I run exactly your command but If I run cat /etc/httpd/conf.d/nagios.conf I obtain this:

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

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Allow from all
# Order deny,allow
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

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

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
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
</Directory>
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't acces Nagios web interface

Post by abrist »

Apoloigies - nagios.conf was the file in question. The vhost config looks fine. Lets try to curl the content and the header:

Code: Select all

curl localhost
curl -I localhost
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.
Yurian00
Posts: 13
Joined: Mon Dec 09, 2013 5:53 am

Re: Can't acces Nagios web interface

Post by Yurian00 »

Curl result:

# curl localhost
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head>
<title>Apache HTTP Server Test Page powered by CentOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body {
background-color: #fff;
color: #000;
font-size: 0.9em;
font-family: sans-serif,helvetica;
margin: 0;
padding: 0;
}
:link {
color: #0000FF;
}
:visited {
color: #0000FF;
}
a:hover {
color: #3399FF;
}
h1 {
text-align: center;
margin: 0;
padding: 0.6em 2em 0.4em;
background-color: #3399FF;
color: #ffffff;
font-weight: normal;
font-size: 1.75em;
border-bottom: 2px solid #000;
}
h1 strong {
font-weight: bold;
}
h2 {
font-size: 1.1em;
font-weight: bold;
}
.content {
padding: 1em 5em;
}
.content-columns {
/* Setting relative positioning allows for
absolute positioning for sub-classes */
position: relative;
padding-top: 1em;
}
.content-column-left {
/* Value for IE/Win; will be overwritten for other browsers */
width: 47%;
padding-right: 3%;
float: left;
padding-bottom: 2em;
}
.content-column-right {
/* Values for IE/Win; will be overwritten for other browsers */
width: 47%;
padding-left: 3%;
float: left;
padding-bottom: 2em;
}
.content-columns>.content-column-left, .content-columns>.content-column-right {
/* Non-IE/Win */
}
img {
border: 2px solid #fff;
padding: 2px;
margin: 2px;
}
a:hover img {
border: 2px solid #3399FF;
}
</style>
</head>

<body>
<h1>Apache 2 Test Page<br><font size="-1"><strong>powered by</font> CentOS</strong></h1>

<div class="content">
<div class="content-middle">
<p>This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page it means that the Apache HTTP server installed at this site is working properly.</p>
</div>
<hr />
<div class="content-columns">
<div class="content-column-left">
<h2>If you are a member of the general public:</h2>

<p>The fact that you are seeing this page indicates that the website you just visited is either experiencing problems or is undergoing routine maintenance.</p>

<p>If you would like to let the administrators of this website know that you've seen this page instead of the page you expected, you should send them e-mail. In general, mail sent to the name "webmaster" and directed to the website's domain should reach the appropriate person.</p>

<p>For example, if you experienced problems while visiting www.example.com, you should send e-mail to "[email protected]".</p>
</div>

<div class="content-column-right">
<h2>If you are the website administrator:</h2>

<p>You may now add content to the directory <tt>/var/www/html/</tt>. Note that until you do so, people visiting your website will see this page and not your content. To prevent this page from ever being used, follow the instructions in the file <tt>/etc/httpd/conf.d/welcome.conf</tt>.</p>

<p>You are free to use the images below on Apache and CentOS Linux powered HTTP servers. Thanks for using Apache and CentOS!</p>

<p><a href="http://httpd.apache.org/"><img src="/icons/apache_pb.gif" alt="[ Powered by Apache ]"/></a> <a href="http://www.centos.org/"><img src="/icons/poweredby.png" alt="[ Powered by CentOS Linux ]" width="88" height="31" /></a></p>
</div>
</div>
</div>
<div class="content">
<div class="content-middle"><h2>About CentOS:</h2><b>The Community ENTerprise Operating System</b> (CentOS) is an Enterprise-class Linux Distribution derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor. CentOS conforms fully with the upstream vendors redistribution policy and aims to be 100% binary compatible. (CentOS mainly changes packages to remove upstream vendor branding and artwork.) The CentOS Project is the organization that builds CentOS.</p>
<p>For information on CentOS please visit the <a href="http://www.centos.org/">CentOS website</a>.</p>
<p><h2>Note:</h2><p>CentOS is an Operating System and it is used to power this website; however, the webserver is owned by the domain owner and not the CentOS Project. <b>If you have issues with the content of this site, contact the owner of the domain, not the CentOS project.</b>
<p>Unless this server is on the CentOS.org domain, the CentOS Project doesn't have anything to do with the content on this webserver or any e-mails that directed you to this site.</p>
<p>For example, if this website is www.example.com, you would find the owner of the example.com domain at the following WHOIS server:</p>
<p><a href="http://www.internic.net/whois.html">htt ... tml</a></p>

</div>
</div>
</body>
</html>


Curl -I result:


#curl -I localhost
HTTP/1.1 403 Forbidden
Date: Mon, 09 Dec 2013 17:19:37 GMT
Server: Apache/2.2.15 (CentOS)
Accept-Ranges: bytes
Content-Length: 5039
Connection: close
Content-Type: text/html; charset=UTF-8
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't acces Nagios web interface

Post by abrist »

Have you added the nagiosadmin user to /usr/local/nagios/etc/htpasswd.user and set a password?

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
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.
Yurian00
Posts: 13
Joined: Mon Dec 09, 2013 5:53 am

Re: Can't acces Nagios web interface

Post by Yurian00 »

Yes, I did it.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't acces Nagios web interface

Post by abrist »

Do me a favor and clear your browser cache and close and reload the broswer. You should be prompted for a username and password.
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.
Locked