I have my nagios server set to use yum-cron to auto apply updates
It upgraded 4.3.4-7.el6.x86_64 to 4.4.3-1.el6.x86_64 from epel
First problem is it has broken the service script /etc/init.d/nagios as an extra if test was introduced without a closing fi directive
This causes the following to happen
$ sudo service nagios status
/etc/init.d/nagios: line 153: syntax error near unexpected token `}'
/etc/init.d/nagios: line 153: `}'
printstatus_nagios ()
{
if status_nagios; then <------------ This line was added it has no closing fi
status_nagios $1 $2
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
return $RETVAL
}
I commented out the new line and the service script then runs and allows you to start nagios
But when I login as nagiosadmin I can only see my nagios host, not the servers I had it set up to monitor
I have checked my cgi.cfg and its unchanged (a new one was delivered in the new version but its there as cgi.cfg.rpmnew)
The error message I get is :
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
Has anything else been changed in 4.4.3 that requires new config to be added for nagiosadmin to be able to see the hosts that were configured?
Alec Keeler
Problems with RHEL6 epel nagios-4.4.3
Problems with RHEL6 epel nagios-4.4.3
Alec Keeler, Build Release and Infrastructure Engineer, Nexor Ltd, Nottingham.
Re: Problems with RHEL6 epel nagios-4.4.3
Just tried to show my host groups and i get
Service Overview For All Host Groups
There are no host groups defined.
My host groups are defined in /etc/nagios/conf.d/
# ls -l /etc/nagios/conf.d/host_groups.cfg
-rw-r--r--. 1 root root 942 Jan 15 14:43 /etc/nagios/conf.d/host_groups.cfg
This config was working with 4.3.4 but is no longer recognised with 4.4.3
When I run the config check I get
[root@prometheus nagios]# /usr/sbin/nagios -v /etc/nagios/nagios.cfg
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 17 services.
Checked 1 hosts.
Checked 0 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 32 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
With the same config files I used to get
Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 87 services.
Checked 7 hosts.
Checked 3 host groups.
Checked 10 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 27 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 7 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Service Overview For All Host Groups
There are no host groups defined.
My host groups are defined in /etc/nagios/conf.d/
# ls -l /etc/nagios/conf.d/host_groups.cfg
-rw-r--r--. 1 root root 942 Jan 15 14:43 /etc/nagios/conf.d/host_groups.cfg
This config was working with 4.3.4 but is no longer recognised with 4.4.3
When I run the config check I get
[root@prometheus nagios]# /usr/sbin/nagios -v /etc/nagios/nagios.cfg
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 17 services.
Checked 1 hosts.
Checked 0 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 32 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
With the same config files I used to get
Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 87 services.
Checked 7 hosts.
Checked 3 host groups.
Checked 10 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 27 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 7 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Alec Keeler, Build Release and Infrastructure Engineer, Nexor Ltd, Nottingham.
Re: Problems with RHEL6 epel nagios-4.4.3
Looks like 4.4.3 is not reading any of the config for hosts, host-groups or service_groups I have configured under /etc/nagios/conf.d
Has the use of /etc/nagios/conf.d been deprecated in 4.4.3 ?
Alec
Has the use of /etc/nagios/conf.d been deprecated in 4.4.3 ?
Alec
Alec Keeler, Build Release and Infrastructure Engineer, Nexor Ltd, Nottingham.
Re: Problems with RHEL6 epel nagios-4.4.3
OK I have sorted the issue, to get it to process the /etc/nagios/conf.d folder I had to add the following line to /etc/nagios/nagios.cfg
cfg_dir=/etc/nagios/conf.d
Now how it was working with 4.3.4 I don't know, but adding that line with 4.4.3 got all my hosts, host_groups, service_groups etc that were configured in the conf.d dir working again
Alec
cfg_dir=/etc/nagios/conf.d
Now how it was working with 4.3.4 I don't know, but adding that line with 4.4.3 got all my hosts, host_groups, service_groups etc that were configured in the conf.d dir working again
Alec
Alec Keeler, Build Release and Infrastructure Engineer, Nexor Ltd, Nottingham.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Problems with RHEL6 epel nagios-4.4.3
Hi @keelerad,
Normally, the configuration files are store in /usr/local/nagios/etc/objects/ and it looks like that was the issue.
All options in the main configuration file, nagios.cfg, are explained here:
Main Configuration File Options
https://assets.nagios.com/downloads/nag ... gmain.html
Let us know if you have any other questions or if it's ok to close this one.
Normally, the configuration files are store in /usr/local/nagios/etc/objects/ and it looks like that was the issue.
All options in the main configuration file, nagios.cfg, are explained here:
Main Configuration File Options
https://assets.nagios.com/downloads/nag ... gmain.html
Let us know if you have any other questions or if it's ok to close this one.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Problems with RHEL6 epel nagios-4.4.3
Checked the rpm and conf.d is not owned by any rpm, so either a post install created it or I did and I forgot.
What surprised me though was that it was working with 4.3.4 but not with 4.4.3.
But adding the definition of this config dir to the main config file nagios.cfg did get everything working again
The problem with the service script is a real issue though for anyone trying to use the epel rpm, not sure if this change is one made by RedHat (who maintain the epel rpms) or is an error introduced from the upstream nagios source
But as I mentioned above just comment out the new test line in /etc/init.d/nagios and it'll work
What surprised me though was that it was working with 4.3.4 but not with 4.4.3.
But adding the definition of this config dir to the main config file nagios.cfg did get everything working again
The problem with the service script is a real issue though for anyone trying to use the epel rpm, not sure if this change is one made by RedHat (who maintain the epel rpms) or is an error introduced from the upstream nagios source
But as I mentioned above just comment out the new test line in /etc/init.d/nagios and it'll work
Code: Select all
printstatus_nagios ()
{
#if status_nagios; then <----------------- comment out this line then it will work,problem is missing fi
status_nagios $1 $2
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
return $RETVAL
}
Alec Keeler, Build Release and Infrastructure Engineer, Nexor Ltd, Nottingham.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Problems with RHEL6 epel nagios-4.4.3
Hi @keelerad,
It's possible there's a difference between what's available from RHEL epel and our source release. The script you have is different than what's in our source code ( ours is not missing fi ), and if the script had been customized then the package manager (yum) would not have updated that file.
Is there another init script in /etc/init.d/
Reference:
How to upgrade Nagios Core
It's possible there's a difference between what's available from RHEL epel and our source release. The script you have is different than what's in our source code ( ours is not missing fi ), and if the script had been customized then the package manager (yum) would not have updated that file.
Is there another init script in /etc/init.d/
Reference:
How to upgrade Nagios Core
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 1
- Joined: Tue Feb 05, 2019 4:04 pm
- Location: Denver, CO
Re: Problems with RHEL6 epel nagios-4.4.3
I had the same printstatus_nagios function problem when patching from 4.3.4 to 4.4.3 where the 'if' without the 'fi' caused the Nagios service to not start.
What is the function supposed to be coded as if 'fi' is supposed to be there?
Also, who will be poking RHEL to push out a bug-fix patch so this doesn't break future updates on other systems?
What is the function supposed to be coded as if 'fi' is supposed to be there?
Also, who will be poking RHEL to push out a bug-fix patch so this doesn't break future updates on other systems?
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Problems with RHEL6 epel nagios-4.4.3
Hi @terror2001
You'll find the code on the Nagios Core Github repository.
https://github.com/NagiosEnterprises/na ... lt-init.in
Here are the repos are for online installations of Nagios XI and NCPA on RHEL operating systems.
https://repo.nagios.com/?repo=rpm-rhel
You'll find the code on the Nagios Core Github repository.
https://github.com/NagiosEnterprises/na ... lt-init.in
Here are the repos are for online installations of Nagios XI and NCPA on RHEL operating systems.
https://repo.nagios.com/?repo=rpm-rhel
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!