segmentation fault while checking

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.
Locked
martinQL
Posts: 10
Joined: Wed Apr 25, 2018 4:22 am

segmentation fault while checking

Post 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:#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: segmentation fault while checking

Post 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.
Former Nagios employee
martinQL
Posts: 10
Joined: Wed Apr 25, 2018 4:22 am

Re: segmentation fault while checking

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: segmentation fault while checking

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked