Nagios -NSCA

Harper Mann hmann at itgroundwork.com
Tue Sep 28 06:26:53 CEST 2004


Nagios should have debug symbols.  How did you run ./configure?  What were
the args?  You can look at config.status in the top dir of nagios to find
out.  

When you run make, unless you turned off symbols, you should get -g -O2 args
in the gcc lines.

You can look at config.log to see if your compiler supports -g.  

Example from my compile:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:610: checking for a BSD compatible install
configure:671: checking host system type
configure:695: checking for gcc
configure:808: checking whether the C compiler (gcc  ) works
configure:824: gcc -o conftest    conftest.c  1>&5
configure:850: checking whether the C compiler (gcc  ) is a cross-compiler
configure:855: checking whether we are using GNU C
configure:864: gcc -E conftest.c
configure:883: checking whether gcc accepts -g
configure:915: checking whether make sets ${MAKE}
configure:944: checking for strip
configure:979: checking how to run the C preprocessor
configure:1000: gcc -E  conftest.c >/dev/null 2>conftest.out
configure:1059: checking for ANSI C header files
configure:1072: gcc -E  conftest.c >/dev/null 2>conftest.out
configure:1139: gcc -o conftest -g -O2   conftest.c  1>&5
configure:1163: checking whether time.h and sys/time.h may both be included
configure:1177: gcc -c -g -O2  conftest.c 1>&5
configure:1198: checking for sys/wait.h that is POSIX.1 compatible
...

There is a function called strncpy that copies a string.  From your gdb
ouput, it's likely getting a null string from a read on the command port or
else something is walking on it.  The code correctly opens the command port
and get's a non-null file handle so it's something after the open and after
reading the pipe.  It looks like this section of code didn't change much
between 1.2 and 2.0a1 so I'm not sure what's going on.

Did you post to the nagios-developer list?  You may get a better response
for 2.0A there as well.

- Harper

Harper Mann
Groundwork Open Source Solutions
510-599-2075 (cell)


-----Original Message-----
From: Sumit Malhotra [mailto:smalhotra at dataarmor.net] 
Sent: Monday, September 27, 2004 8:52 PM
To: hmann at itgroundwork.com; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Nagios -NSCA

Hi Harper, 
  
Thanks for your help so far. Here is teh detail you asked for : 
  
  
--------------------------------------------------------------------------- 
  
(gdb) run /etc/nagios/nagios.cfg 
Starting program: /usr/sbin/nagios /etc/nagios/nagios.cfg 
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...[Thread debugging using libthread_db enabled] 
[New Thread -1085094336 (LWP 23666)] 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)... 
Nagios 2.0a1 
Copyright (c) 1999-2004 Ethan Galstad (nagios at nagios.org) 
Last Modified: 11-18-2003 
License: GPL 
(no debugging symbols found)...Nagios 2.0a1 starting... (PID=23666) 
[New Thread -1085097040 (LWP 23673)] 
[New Thread -1095586896 (LWP 23674)] 
Warning: The results of host 'test' are stale by 11606 seconds
(threshold=900 seconds).  I'm forcing an immediate check of the host. 
Warning: The results of host 'kirk' are stale by 11467 seconds
(threshold=900 seconds).  I'm forcing an immediate check of the host. 
Warning: The results of host 'mail' are stale by 11591 seconds
(threshold=900 seconds).  I'm forcing an immediate check of the host. 
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread -1085094336 (LWP 23666)] 
0x00940400 in strncpy () from /lib/tls/libc.so.6 
(gdb) 
(gdb) bt 
#0  0x00940400 in strncpy () from /lib/tls/libc.so.6 
#1  0x0805e01e in check_for_external_commands () 
#2  0x08062de3 in event_execution_loop () 
#3  0x080526c7 in main () 

----------------------------------------------------------------------------
--- 

Thanks & Regards, 
Sumit Malhotra 
Data Armor 
  
  
-----Original Message----- 
From: Harper Mann 
Sent: Mon Sep 27 22:31:36 CDT 2004 
To: Sumit Malhotra ; nagios-users at lists.sourceforge.net 
Subject: RE: [Nagios-users] Nagios -NSCA
  
  
Can you run "gdb nagios" and get a stack trace and post it?   

When gdb initially gives a prompt enter "run -c <path>/nagios.cfg".  Then, 
when it gets "SIGSEGV", and you get the gdb prompt again, enter "bt" and 
then send the output.  This should tell where it died. 

Regards, 

- Harper 

Harper Mann 
Groundwork Open Source Solutions 
510-599-2075 (cell) 


-----Original Message----- 
From: Sumit Malhotra [mailto:smalhotra at dataarmor.net] 
Sent: Monday, September 27, 2004 8:26 PM 
To: hmann at itgroundwork.com; nagios-users at lists.sourceforge.net 
Subject: RE: [Nagios-users] Nagios -NSCA 

   
   
-----Original Message----- 
From: Harper Mann 
Sent: Mon Sep 27 22:10:49 CDT 2004 
To: Sumit Malhotra ; nagios-users at lists.sourceforge.net 
Subject: RE: [Nagios-users] Nagios -NSCA 
   
   
NSCA opens the Nagios command pipe, usually 
/usr/local/nagios/var/rw/nagios.cmd, which is closed and remade with each 
nagios restart.  The NSCA process must be stopped and restarted when nagios 
dies to open the new pipe. 
>>>> That's OK, but there is an option of Alternate Dump File which should 
work if the nagios  goes down. But nsca doen't append anything to it if the 
nagios goes down   
Secondly ,  Nagios is getting  Shutt down due to run time error ( SISSEGV), 
how do i find out a solution to that ?   
   
   
Thanks & Regards, 
Sumit Malhotra 
Data Armor 

Another option is to set up NSCA under xinet so it's started with each send 
request and the nagios.cmd command pipe is opened each time.  The downside 
is the process startup cost each time a check result is sent.  However, this


usually works pretty well. 

Regards, 

- Harper 

Harper Mann 
Groundwork Open Source Solutions 
510-599-2075 (cell) 


-----Original Message----- 
From: nagios-users-admin at lists.sourceforge.net 
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Sumit 
Malhotra 
Sent: Monday, September 27, 2004 3:50 PM 
To: nagios-users at lists.sourceforge.net 
Subject: [Nagios-users] Nagios -NSCA 

Hi all, 


I am using nagios-nsca-2.4  with nagios 2a 

The problems is that nagios  dies  after some time  ( I don't know why 
?) no errors .. just.. 
It says . 

1096321093] Caught SIGSEGV, shutting down.. 


Nagios Goes down and nsca processes getting stuck up.. 

Sep 27 16:43:52 monitoring nsca[12880]: SERVICE CHECK -> Host Name: 
'kirk2', Service Description: 'Check load', Return Code: '0', Output: 
'OK - load average: 1.01, 0.49, 0.18' 
Sep 27 16:43:53 monitoring nsca[12882]: Handling the connection... 

and nothing else .. 

This results in a endless number of processes making the monitoring 
server ( HANG) 

----nsca.cfg--------------- 
server_port=5667 
allowed_hosts=XX.YY.ZZ.00 
nsca_user=nagios 
nsca_group=nagios 
debug=1 
command_file=/var/spool/nagios/nagios.cmd 
alternate_dump_file=/var/spool/nagios/nsca.dump 
aggregate_writes=0 
append_to_file=0 
max_packet_age=30 
password=xxxxxx 
decryption_method=1 
-------------------------------------------------- 

But as per the configuration, it should have dumped the data to 
alternate dumped file but that doesn't work any clues ?? 

Regards, 
Sumit 



------------------------------------------------------- 
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 
Project Admins to receive an Apple iPod Mini FREE for your judgement on 
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php 
_______________________________________________ 
Nagios-users mailing list 
Nagios-users at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/nagios-users 
::: Please include Nagios version, plugin version (-v) and OS when reporting


any issue. 
::: Messages without supporting info will risk being sent to /dev/null 




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list