Page 1 of 1

No idea whats going on with nagios

Posted: Mon Mar 14, 2022 5:51 am
by vmwareguy
Nagios is one of those apps that just works all the time so I don't spend much time under the hood looking. Because of that I really don't have any idea where to start troubleshooting. I came in this morning - tried to log into the application and received this when going to the login screen.

Code: Select all

<?php ?><?php // Copyright (c) 2008-2021 Nagios Enterprises, LLC.  All rights reserved. ?><?php
if(!function_exists('sg_load')){$__v=phpversion();$__x=explode('.',$__v);$__v2=$__x[0].'.'.(int)$__x[1];$__u=strtolower(substr(php_uname(),0,3));$__ts=(@constant('PHP_ZTS') || @constant('ZEND_THREAD_SAFE')?'ts':'');$__f=$__f0='ixed.'.$__v2.$__ts.'.'.$__u;$__ff=$__ff0='ixed.'.$__v2.'.'.(int)$__x[2].$__ts.'.'.$__u;$__ed=@ini_get('extension_dir');$__e=$__e0=@realpath($__ed);$__dl=function_exists('dl') && function_exists('file_exists') && @ini_get('enable_dl') && !@ini_get('safe_mode');if($__dl && $__e && version_compare($__v,'5.2.5','<') && function_exists('getcwd') && function_exists('dirname')){$__d=$__d0=getcwd();if(@$__d[1]==':') {$__d=str_replace('\\','/',substr($__d,2));$__e=str_replace('\\','/',substr($__e,2));}$__e.=($__h=str_repeat('/..',substr_count($__e,'/')));$__f='/ixed/'.$__f0;$__ff='/ixed/'.$__ff0;while(!file_exists($__e.$__d.$__ff) && !file_exists($__e.$__d.$__f) && strlen($__d)>1){$__d=dirname($__d);}if(file_exists($__e.$__d.$__ff)) dl($__h.$__d.$__ff); else if(file_exists($__e.$__d.$__f)) dl($__h.$__d.$__f);}if(!function_exists('sg_load') && $__dl && $__e0){if(file_exists($__e0.'/'.$__ff0)) dl($__ff0); else if(file_exists($__e0.'/'.$__f0)) dl($__f0);}if(!function_exists('sg_load')){$__ixedurl='http://www.sourceguardian.com/loaders/download.php?php_v='.urlencode($__v).'&php_ts='.($__ts?'1':'0').'&php_is='.@constant('PHP_INT_SIZE').'&os_s='.urlencode(php_uname('s')).'&os_r='.urlencode(php_uname('r')).'&os_m='.urlencode(php_uname('m'));$__sapi=php_sapi_name();if(!$__e0) $__e0=$__ed;if(function_exists('php_ini_loaded_file')) $__ini=php_ini_loaded_file(); else $__ini='php.ini';if((substr($__sapi,0,3)=='cgi')||($__sapi=='cli')||($__sapi=='embed')){$__msg="\nPHP script '".__FILE__."' is protected by SourceGuardian and requires a SourceGuardian loader '".$__f0."' to be installed.\n\n1) Download the required loader '".$__f0."' from the SourceGuardian site: ".$__ixedurl."\n2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="\n3) Edit ".$__ini." and add 'extension=".$__f0."' directive";}}$__msg.="\n\n";}else{$__msg="<html><body>PHP script '".__FILE__."' is protected by <a href=\"http://www.sourceguardian.com/\">SourceGuardian</a> and requires a SourceGuardian loader '".$__f0."' to be installed.<br><br>1) <a href=\"".$__ixedurl."\" target=\"_blank\">Click here</a> to download the required '".$__f0."' loader from the SourceGuardian site<br>2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__msg.="<br>3) Edit ".$__ini." and add 'extension=".$__f0."' directive<br>4) Restart the web server";}}$__msg.="</body></html>";}die($__msg);exit();}}return sg_load('52C4625F2E437708AAQAAAAXAAAABHAAAACABAAAAAAAAAD/Ak8xfwFu+dHopSYFVroEJDj7YMsCSar9MnknQ/547zMyQgcFqzxo4KWPDCYTyWcHnU2AwHCBydyGxmlOsXyhUtQmLaPr1ymcVTkYZ2LJCFUjVu8JpjsY3oVvjwzv5ZntfsBsGBv9rfDb4gPMXfjeazUAAAAAmAAA4BvzoxuCOzTpk2CV/+nUhMpJZFJrCkBKd0jusU7Srs5ZdmvvsYCNjXO3M3+6+QGOjhKCL3ymtCeqJIJogwEgUbneDKVoCUEfr27FyCCq3qfmZaaPj3e5bN1n1CstedhhXFmarArVqsXYAoSiSoLGoxjQOEabh0GhFrWkv1w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C6dIEaIY5ecnW0XMwf8sVDeatQ4kgKr9/53ZxU6QA8TyixsE6lw/6OSWqq6gtCsNevceH3bsh3UFq/oEXVst+vgjbEjIzGptuByDT9FGU6zWo9d3GzkHQDtuU7Kvu99Pi9/aLy5Vt1k9aTEh8DU893/Ey7lQ9QtxU9gupCkm1Cu6ngniopoDTJVRL6UXKsdEfOdPU6jUJqe1YXXPbBoFQl9WOdygx8c28jER/IzTmRSTrzBEotOTbSfbcGAcOcpnFmJ4oSIHWcF9cMU4pskQMGpm6HF579McPBcQnYxQJv6DO+yhLYPL2ursrzzmtX7Y8O5os1tAi9mz/G3rPbNFH48uTpoJ9XEXa9f1kGObxthnihdY16IYtYgvDT4VZWBIDaJl7vRC1FHNf9/vbVe6+tHCvkqrr7iI5AKgebKXUP1tbVrern76wQzqxln0YKHTN3KiqK8U4A3Jn0sN81UCD7Kn6cOXL1IoplTI7H2YsmBf3oPCVozhdA3xLPLAHdUFlwfzxUtICu6D+a5JfWyzWQJM+/6QAVz+FXg1KzhNCXSp/FeAr3x2cpzD2v3R83t4mdmyLBBz9pqCXFqblLyK8o1WJqmyDvwZ4F7BSzMAj3phZB6X7rIgmm79HN3EbtH49fmnNzvN2hIrl6fw6/g
I check Apache and everything seems fine
[zeus@chunk ~]$ apachectl status
* httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-03-14 06:39:44 EDT; 7min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 1713 (httpd)
Status: "Total requests: 8; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
|-1713 /usr/sbin/httpd -DFOREGROUND
|-1823 /usr/sbin/httpd -DFOREGROUND
|-1824 /usr/sbin/httpd -DFOREGROUND
|-1825 /usr/sbin/httpd -DFOREGROUND
|-1827 /usr/sbin/httpd -DFOREGROUND
|-1828 /usr/sbin/httpd -DFOREGROUND
|-2568 /usr/sbin/httpd -DFOREGROUND
|-2571 /usr/sbin/httpd -DFOREGROUND
`-2572 /usr/sbin/httpd -DFOREGROUND

Mar 14 06:39:44 chunk.dmz.spf.nawcad.navy.mil systemd[1]: Starting The Apache HTTP Server...
Mar 14 06:39:44 chunk.dmz.spf.nawcad.navy.mil systemd[1]: Started The Apache HTTP Server.
[zeus@chunk ~]$ apachectl configtest
Syntax OK
Any thoughts ?

Re: No idea whats going on with nagios

Posted: Mon Mar 14, 2022 6:06 am
by vmwareguy
I am seeing tons of No matching Directory Errors in the /var/log/httpd/error_log

Code: Select all

[Mon Mar 14 06:39:44.993526 2022] [core:notice] [pid 1713] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Mar 14 06:40:16.785633 2022] [autoindex:error] [pid 1825] [client 160.107.103.23:54164] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 06:43:03.695410 2022] [autoindex:error] [pid 1824] [client 127.0.0.1:33724] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 06:48:02.099398 2022] [autoindex:error] [pid 2568] [client 127.0.0.1:34678] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 06:53:01.671255 2022] [autoindex:error] [pid 2571] [client 127.0.0.1:35626] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 06:58:01.424312 2022] [autoindex:error] [pid 2572] [client 127.0.0.1:36574] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 06:59:35.586743 2022] [autoindex:error] [pid 1825] [client 160.107.103.23:54787] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 07:00:02.759331 2022] [autoindex:error] [pid 1823] [client 160.107.103.23:54825] AH01276: Cannot serve directory /usr/local/nagiosxi/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Mon Mar 14 07:01:31.351990 2022] [mpm_prefork:notice] [pid 1713] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Mar 14 07:01:32.573661 2022] [suexec:notice] [pid 6003] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Mar 14 07:01:32.650649 2022] [lbmethod_heartbeat:notice] [pid 6003] AH02282: No slotmem from mod_heartmonitor
[Mon Mar 14 07:01:32.659507 2022] [mpm_prefork:notice] [pid 6003] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Mon Mar 14 07:01:32.659563 2022] [core:notice] [pid 6003] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Re: No idea whats going on with nagios

Posted: Mon Mar 14, 2022 6:24 am
by vmwareguy
I added index.php to the httpd.conf file (has I have seen others do)

Code: Select all

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>
Now I can at least see the
Welcome
Click the link below to get started using Nagios XI.
Access Nagios XI (blue button)

But when I click it I get the following

Code: Select all

<?php
//
// Copyright (c) 2008-2020 Nagios Enterprises, LLC. All rights reserved.
//

require_once(dirname(__FILE__) . '/includes/common.inc.php');


// Initialization stuff
pre_init();
init_session();

// Grab GET or POST variables and check pre-reqs
grab_request_vars();
check_prereqs();


route_request_main();


function route_request_main()
{
    $default_page = PAGE_HOME;

    if (is_authenticated() == false) {
        header("Location: " . get_base_url() . PAGEFILE_LOGIN);
    }

    $page = grab_request_var("page", $default_page);

    display_page($page);
}


function display_page($page = PAGE_HOME)
{
    $filename = dirname(__FILE__) . '/includes/page-' . $page . '.php';
    $errorfile = dirname(__FILE__) . '/includes/page-missing.php';

    if (file_exists($filename)) {
        include_once($filename);
    } else {
        include_once($errorfile);
    }
}

Re: No idea whats going on with nagios

Posted: Mon Mar 14, 2022 7:16 am
by vmwareguy
So somehow php got uninstalled - reinstalled and working now

Re: No idea whats going on with nagios

Posted: Wed Mar 16, 2022 4:40 pm
by mbellerue
Ack. Apologies in the delay in response. I'm glad you got it figured out though. And thank you for posting your progress and resolution!