Page 1 of 1

Nagios 4.4.5 installation issue

Posted: Thu Sep 24, 2020 4:05 am
by hysabcz
Hi All,

I am trying to install Nagios 4.4.5 on RHEL machine, did not face any issues during the installation but i am getting 403 forbidden error when I try to login the nagios core url. so after changing index.html to index.php i am getting below page. Php already installed on the server
php --version
PHP 7.4.2 (cli) (built: Apr 2 2020 16:01:49) ( ZTS )



<?php
// Allow specifying main window URL for permalinks, etc.
$url = 'main.php';

if ("no" == "yes" && isset($_GET['corewindow'])) {

// The default window url may have been overridden with a permalink...
// Parse the URL and remove permalink option from base.
$a = parse_url($_GET['corewindow']);

// Build the base url.
$url = htmlentities($a['path']).'?';
$url = (isset($a['host'])) ? $a['scheme'].'://'.$a['host'].$url : '/'.$url;

$query = isset($a['query']) ? $a['query'] : '';
$pairs = explode('&', $query);
foreach ($pairs as $pair) { compress photos
$v = explode('=', $pair);
if (is_array($v)) {
$key = urlencode($v[0]);
$val = urlencode(isset($v[1]) ? $v[1] : '');
$url .= "&$key=$val";
}
}
if (preg_match("/^http:\/\/|^https:\/\/|^\//", $url) != 1)
$url = "main.php";
}

$this_year = '2019';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

<html>
<head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<title>Nagios: <?php echo $_SERVER['SERVER_NAME']; ?></title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">

<script LANGUAGE="javascript">
var n = Math.round(Math.random() * 10000000000);
document.cookie = "NagFormId=" + n.toString(16);
</script>
</head>

<frameset cols="180,*" style="border: 0px; framespacing: 0px">
<frame src="side.php" name="side" frameborder="0" style="">
<frame src="<?php echo $url; ?>" name="main" frameborder="0" style="">

<noframes>
<!-- This page requires a web browser which supports frames. -->
<h2>Nagios Core</h2>
<p align="center">
<a href="https://www.nagios.org/">www.nagios.org</a><br>
Copyright © 2010-<?php echo $this_year; ?> Nagios Core Development Team and Community Contributors.
Copyright © 1999-2010 Ethan Galstad<br>
</p>
<p>
<i>Note: These pages require a browser which supports frames</i>
</p>
</noframes>
</frameset>

</html>

below the error_log

[Fri Sep 24 15:27:30.504195 2020] [suexec:notice] [pid 16968] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Sep 24 15:27:30.523932 2020] [lbmethod_heartbeat:notice] [pid 16968] AH02282: No slotmem from mod_heartmonitor
[Fri Sep 24 15:27:30.528948 2020] [mpm_prefork:notice] [pid 16968] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Fri Sep 24 15:27:30.528978 2020] [core:notice] [pid 16968] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

access_log

[24/Sep/2020:15:28:27 -0500] "GET /nagios/ HTTP/1.1" 401 381 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
nagiosadmin [24/Sep/2020:15:28:34 -0500] "GET /nagios/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"

Not sure if my error is due to permission, can someone help me what could be the problem.

Re: Nagios 4.4.5 installation issue

Posted: Thu Sep 24, 2020 5:29 pm
by benjaminsmith
Hi,

Actually, Nagios Core does not use PHP - it uses CGI scripts that are written C, so it's really fast.

Was this a clean system ( no other applications)? Normally it should just work. I would recommend following the instructions below a fresh RHEL server and let us know how that goes.

https://support.nagios.com/kb/article/n ... ce-96.html

--Benjamin