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.
chris_rr wrote:On a stock ubuntu 16.04 install, those instructions produce the following upon execution:
#service apache2 restart
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
apache2[22876]: AH00526: Syntax error on line 23 of /etc/apache2/sites-enabled/nagios.conf:
apache2[22876]: Invalid command 'AuthFormLoginRequiredLocation', perhaps misspelled or defined by a module not included in the server configuration
apache2[22876]: Action 'configtest' failed.
apache2[22876]: The Apache error log may have more information.
So... what module/package does 4.3 now require to be installed to make this work?
--C
Looks like the new nagios.conf file has been updated and requires some modules. Execute the the following commands and it should work now:
Pikmin wrote:Centos 7 here, same problem
I have installed mod_session and now I get an error message about something else
AH00526: Syntax error on line 28 of /etc/httpd/conf.d/nagios.conf:
Feb 23 09:56:46 nagios httpd[945]: Invalid command 'SessionCryptoPassphrase', perhaps misspelled or defined by a module not included in the ...iguration
Feb 23 09:56:46 nagios systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Maps are not working for me either anymore:
Last Updated: {{lastUpdate | date:'EEE MMM dd HH:mm:ss yyyy'}}
Nagios® Core™ {{json.data.programstatus.version}} - http://www.nagios.org
Updated every {{updateInterval}} seconds
Logged in as {{json.result.user}}
Warning: Monitoring process may not be running!
Click here for more info.
- Notifications are disabled
- Service checks are disabled
I've been able to progress your issue however I can't get past the new login screen.
I have since done the same before seeing your post and can login to the Nagios Core instance, pretty much enabled the same two modules
I was stuck there for a while as httpd refused to start, until I saw the httpd error log which pointed me to install apr-util-openssl
So everything appears to be working correctly except the new maps, now there's a new login page. If I keep the old /etc/httpd/conf.d/nagios.conf and still use 4.3.0 it also works as long as I make the modification posted in this thread (by jfrickson), though map issue is present as well.
I´am running Nagios on latest Debian with my own created nagios.conf Apache2 configuration file.
I can´t use make install-webconf because it replace all my specific settings (our users are authenticated on Windows domain etc).
Then we don´t need new Login and Logout functions in Nagios 4.3.0.
For me, adding the line ScriptAlias /nagios/cgibin "/usr/local/nagios/sbin"
to my own nagios.conf which is located in /etc/apache2/conf-available helps me. After this change I restarted Apache2 service and upgrade Nagios to 4.3.0. Now all links works fine and at Home page is displayed Daemon running with PID xxx.
PS: from side.php I removed Logout link.
I hope this helps other users.
But there are another issues on 4.3.0 now.
Map, Trends and Histogram does not anymore.
These functions display the error in attachment. What´s wrong? Legacy links working fine.
Pikmin wrote:The maps appears to be a separate issue, legacy works fine for me too, will have another go tomorrow at work
I had the same problem. I figured out that config.js in /usr/local/nagios/share/js is missing. I looked into the source tar and found a config.js.in. This file needs to be copied to the js directory, renamed (config.js) and modified. Replace value @cgiurl@ with cgibin, so the file looks like: var nagcfg = {};
nagcfg.cgidir = "cgibin/";
[root@centos ~]# cd /etc/httpd/conf.d/
[root@centos conf.d]# ls
nagios.conf php.conf README welcome.conf
[root@centos conf.d]# cp nagios.conf nagios.conf.bak
[root@centos conf.d]# ls
[root@centos conf.d]# ls
nagios.conf nagios.conf.bak php.conf README welcome.conf
[root@centos conf.d]# cd
[root@centos ~]# cd downloads/nagios-4.3.0
[root@centos nagios-4.3.0]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
if [ 0 -eq 1 ]; then \
ln -s /etc/httpd/conf.d/nagios.conf /etc/apache2/sites-enabled/nagios.conf; \
fi
*** Nagios/Apache conf file installed ***
[root@centos nagios-4.3.0]# service restart httpd
restart: unrecognized service
[root@centos nagios-4.3.0]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Thu Feb 23 13:01:23 2017] [warn] Useless use of AllowOverride in line 15 of /etc/httpd/conf.d/nagios.conf.
Syntax error on line 38 of /etc/httpd/conf.d/nagios.conf:
Invalid command 'AuthFormLoginRequiredLocation', perhaps misspelled or defined by a module not included in the server configuration
[FAILED]
[root@centos nagios-4.3.0]# cat /etc/httpd/conf.d/nagios.conf
# 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/cgibin "/usr/local/nagios/sbin"
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
Alias /nagios "/usr/local/nagios/share"
<Location "/nagios">
# SSLRequireSSL
Options None
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd.users
AuthType form
AuthFormLoginRequiredLocation "/nagios/login.html"
Session On
SessionCookieName NagiosSession path=/nagios
SessionEnv On
SessionCryptoPassphrase "fb893181c5925849ea5ad8d2ba99c53f"
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
AuthType form
AuthFormLoginRequiredLocation "/nagios/login.html"
Session On
SessionCookieName NagiosSession path=/nagios
SessionEnv On
SessionCryptoPassphrase "fb893181c5925849ea5ad8d2ba99c53f"
Require valid-user
</IfVersion>
</Location>
<Location "/nagios/cgi-bin">
# 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>
</Location>
<LocationMatch "/nagios/(login.html|images/corelogo.gif)">
Require all granted
</LocationMatch>
<Location "/nagios/dologin.html">
Order allow,deny
Allow from all
SetHandler form-login-handler
AuthFormProvider file
AuthUserFile /usr/local/nagios/etc/htpasswd.users
AuthType form
AuthName "Nagios Access"
AuthFormLoginRequiredLocation "/nagios/login.html"
AuthFormLoginSuccessLocation "/nagios/index.php"
Session On
SessionCookieName NagiosSession path=/nagios
SessionEnv On
SessionCryptoPassphrase "fb893181c5925849ea5ad8d2ba99c53f"
</Location>
<Location /nagios/dologout>
SetHandler form-logout-handler
AuthFormLogoutLocation /nagios/login.html?logoff
session On
# Expire the session
SessionMaxAge 1
SessionCookieName NagiosSession path=/nagios
SessionCryptoPassphrase "fb893181c5925849ea5ad8d2ba99c53f"
</Location>
It seems that this upgrade was released without fully testing.
Dou you also enable session, session_cookie, and session_crypto apache modules after you installed new nagios.conf? Try this from previous post: sudo a2enmod rewrite
sudo a2enmod request
sudo a2enmod auth_form
sudo a2enmod session_cookie
sudo a2enmod session_crypto
sudo a2enmod cgi
sudo systemctl restart apache2.service