Page 1 of 1

segmentation fault while checking

Posted: Mon Apr 30, 2018 7:32 am
by martinQL
I found an issue in Core 4.3.4 during some tests:

Normaly the command "nagios -v /etc/nagios/nagios.cfg" checks the configuration and printout some information.

But when we create a servicegroup configuration with an non-existent servicegroup member like:

Code: Select all

define servicegroup {
        servicegroup_name               mygroup
        alias                           description
        members                         localhost,Total Processes,localhost,Root Partition,localhost,Current Users
        servicegroup_members            idonotexist
}
The test will end up with a segmentation fault:
myhost:# /usr/sbin/nagios -v /etc/nagios/nagios.cfg

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...
Error: Could not find member group 'idonotexist' specified in servicegroup 'mygroup' (config file '/etc/nagiosql/servicegroups.cfg', starting on line 21)
Segmentation fault
myhost:#

Re: segmentation fault while checking

Posted: Mon Apr 30, 2018 11:35 am
by tmcdonald
Testing against 4.4.0 (not officially released but available for testing nonetheless) I was unable to reproduce:

Code: Select all

[root@54f51d95631a objects]# ../../bin/nagios -v ../nagios.cfg

Nagios Core 4.4.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-01-22
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Could not find member group 'idonotexist' specified in servicegroup 'mygroup' (config file '/usr/local/nagios/etc/objects/commands.cfg', starting on line 14)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data definitions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
My setup is fairly simple, just the standard GitHub repo configs + the config example you listed above to trigger it. Can you try reproducing this on the latest Core? This looks to have already been fixed, intentionally or otherwise.

Re: segmentation fault while checking

Posted: Mon Apr 30, 2018 2:02 pm
by martinQL
Hello tmcdonald

Yes with 4.4.0 from GitHub I cannot reproduce this issue:

Code: Select all

myhost:/opt/nagios/nagioscore-master/base # ./nagios -v /etc/nagios/nagios.cfg

Nagios Core 4.4.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-01-22
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Could not find member group 'idonotexist' specified in servicegroup 'myGroup' (config file '/etc/nagiosql/servicegroups.cfg', starting on line 14)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data definitions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

myhost:/opt/nagios/nagioscore-master/base #
Seems to be fixed now. Thank you.

Martin

Re: segmentation fault while checking

Posted: Mon Apr 30, 2018 2:10 pm
by lmiltchev
I am glad your issue has been resolved! I am locking this topic. If you have any more questions/issues, please start a new thread.