Page 1 of 2

Memory fault NetBSD 6.0 Sparc

Posted: Fri Oct 11, 2013 6:16 pm
by jusavard
Hi,
I just compiled nagios 3.5.1 from source under netbsd 6.0. I had to do some tricks to make this far but I still have a problem.

When trying to run nagios from /etc/rc.d I have this error :

ra1# /etc/rc.d/nagios start
Starting nagios:su: no directory
[1] Segmentation fault ${NagiosBin} -d ...
done.

When trying to run directly as daemon i have this error :

ra1# /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Memory fault
ra1#

nagios.cfg is vanilla. It's default settings.

Have any Idea ?

Re: Memory fault NetBSD 6.0 Sparc

Posted: Mon Oct 14, 2013 9:34 am
by slansing
Have you taken a look at this thread yet?:

http://support.nagios.com/forum/viewtop ... ory#p74447

Re: Memory fault NetBSD 6.0 Sparc

Posted: Tue Oct 15, 2013 7:11 pm
by jusavard
Hi thanks for the reply... unfortunaly it doesn't works...

Code: Select all

ra1# /etc/rc.d/nagios start     
.: Can't open /lib/lsb/init-functions
ra1# 
Link looks like more "Ubuntu" oriented... don't forget i'm running NetBSD.
I would have though that even if the /etc/rc.d script doesn't work starting the deamon stad alone would work... but it does't ...

Code: Select all

usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg                                                                     <

Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 8 services.
Checking hosts...
        Checked 1 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 24 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
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
ra1# 

Code: Select all

ra1# /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg  
Memory fault 
ra1# 
Have any more idea ?

Re: Memory fault NetBSD 6.0 Sparc

Posted: Wed Oct 16, 2013 1:39 pm
by sreinhardt
As much of a pain as it may be, are you getting core dumps from these segfaults? Are you able to start nagios without -d and run it in the foreground?

Re: Memory fault NetBSD 6.0 Sparc

Posted: Thu Oct 17, 2013 9:55 pm
by jusavard
Well... even without "-d" option it still gives me about the same message error :

Code: Select all

ra1# /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg  

Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL

Website: http://www.nagios.org
Memory fault 
ra1# 

I did these modification in nagios.cfg...

Code: Select all

daemon_dumps_core=1
debug_level=-1
But it doesn't seems to gives me much :

Code: Select all

ra1# cat nagios.debug   
[0.1382046559] [32823.1] [pid=0] drop_privileges() start
[0.1382046559] [34686.4] [pid=0] Original UID/GID: 0/0
[0.1382046559] [51851.4] [pid=0] New UID/GID: 1002/1001
[0.1382046575] [147029.1] [pid=0] drop_privileges() start
[0.1382046575] [148449.4] [pid=0] Original UID/GID: 0/0
[0.1382046575] [165867.4] [pid=0] New UID/GID: 1002/1001
[0.1382046617] [259386.1] [pid=0] drop_privileges() start
[0.1382046617] [261002.4] [pid=0] Original UID/GID: 0/0
[0.1382046617] [278337.4] [pid=0] New UID/GID: 1002/1001
[0.1382046629] [320585.1] [pid=0] drop_privileges() start
[0.1382046629] [322266.4] [pid=0] Original UID/GID: 0/0
[0.1382046629] [339598.4] [pid=0] New UID/GID: 1002/1001   

Code: Select all

ra1# tail /var/log/messages 
Oct 17 21:42:38  nagios: Nagios 3.5.1 starting... (PID=12158)
Oct 17 21:42:45  nagios: Nagios 3.5.1 starting... (PID=12462)
Oct 17 21:42:55  nagios: Nagios 3.5.1 starting... (PID=12027)
Oct 17 21:45:06  nagios: Nagios 3.5.1 starting... (PID=775)
Oct 17 21:45:10  nagios: Nagios 3.5.1 starting... (PID=1732)
Oct 17 21:47:15  nagios: Nagios 3.5.1 starting... (PID=11185)
Oct 17 21:49:19  nagios: Nagios 3.5.1 starting... (PID=807)
Oct 17 21:49:35  nagios: Nagios 3.5.1 starting... (PID=980)
Oct 17 21:50:17  nagios: Nagios 3.5.1 starting... (PID=12091)
Oct 17 21:50:29  nagios: Nagios 3.5.1 starting... (PID=12109)
ra1# 
About the core dump I always thougt that it was only during a Kernel Panic... But whatever... I have nothing in /var/crash

Code: Select all

ra1# ls -l /var/crash/       
total 2
-rw-------  1 root  wheel  5 Oct 13  2012 minfree
ra1# cat /var/crash/minfree  
1024
ra1#


Do you know have any more idea...?

Re: Memory fault NetBSD 6.0 Sparc

Posted: Fri Oct 18, 2013 11:42 am
by sreinhardt
Well, you are failing in one of two places. Either dropping privileges is not working, which we are not seeing a failure from core about that as would be expected, or the next step after privilege drops is to load the nagios.cfg. Can you take that config to a standard x86 or x64 linux system and try starting nagios with those configs on there?

Re: Memory fault NetBSD 6.0 Sparc

Posted: Mon Oct 21, 2013 11:13 am
by jusavard
Well, I think I have a NetBSD under XEN amd64 lying somewhere. I could try it...
However i must say that exept debug_level=-1 and debug_verbosity=2 the nagios.cfg is vanilla. No changes has been done. This file result of the compilation.

Re: Memory fault NetBSD 6.0 Sparc

Posted: Mon Oct 21, 2013 12:33 pm
by MichaelMoritz
I am running 3.5.1 on NetBSD 6.1.2 on i386. Your configs look pretty small, if you zip them up I'd be willing try them on my server.

Re: Memory fault NetBSD 6.0 Sparc

Posted: Mon Oct 21, 2013 12:42 pm
by abrist
You may very well have to open a bug report on http://tracker.nagios.org. Post the core dump and the install log, along with the errors you are experiencing.

Re: Memory fault NetBSD 6.0 Sparc

Posted: Wed Oct 23, 2013 7:11 pm
by jusavard
i tried compiling nagios under NetBSD X86_64 Domu... well it seems problems come in pair :

Code: Select all

Creating sample config files in sample-config/ ...


*** Configuration summary for nagios 3.5.1 08-30-2013 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
            Embedded Perl:  no
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /usr/bin/mail
                  Host OS:  netbsd6.0

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

Code: Select all

netbsd# make all
cd ./base && make
cd ./cgi && make
cd ./html && make
if [ xyes = xyes ]; then  cd ./module && make;  fi
gcc  -g -O2 -DHAVE_CONFIG_H -o helloworld.o helloworld.c -shared
ld: /var/tmp//cc8ltA5p.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/var/tmp//cc8ltA5p.o: could not read symbols: Bad value
*** Error code 1

Stop.
make: stopped in /root/nagios/module
*** Error code 1

Stop.
make: stopped in /root/nagios
netbsd#

Every thing should be there :

Code: Select all

netbsd# pkgin list
apache-2.4.6         Apache HTTP (Web) server, version 2.4
apr-1.4.8            Apache Portable Runtime
apr-util-1.5.2       Apache Portable Runtime utilities
fontconfig-2.10.95   Library for configuring and customizing font access
gd-2.1.0             Graphics library for the dynamic creation of images
jbigkit-2.0          JBIG-KIT lossless image compression library
jpeg-9               IJG's jpeg compression utilities
libidn-1.28          Internationalized Domain Names command line tool
libvpx-1.2.0         On2 VP8 library from Google
libxml2-2.9.1        XML parser library from the GNOME project
pcre-8.33            Perl Compatible Regular Expressions library
perl-5.18.1nb1       Practical Extraction and Report Language
php-5.4.20           PHP Hypertext Preprocessor version 5.4
pkg_install-20130902 Package management and administration tools for pkgsrc
pkgin-0.6.4nb1       Apt / yum like tool for managing pkgsrc binary packages
png-1.6.5            Library for manipulating PNG images
tiff-4.0.3nb6        Library and tools for reading and writing TIFF data files
wget-1.14nb3         Retrieve files from the 'net via HTTP and FTP
xmlcatmgr-2.2nb1     XML and SGML catalog manager
netbsd#