recursive cfg_dir

Andreas Ericsson ae at op5.se
Fri Jun 10 17:16:50 CEST 2005


jbiskofski wrote:
> Andreas, 
> 
> Thank you for your help and time. 
> 
> I had a little bit of trouble compiling your program on freebsd, what I had 
> to do was move the " file_list *list = NULL; " line in main() to the top of 
> the function. Anyway, I though that might be useful to you , or to someone 
> else running fbsd. In any event, I ran it and now I have some output, and a 
> core file. :]
> 

That's odd. It's pretty much posix-only code in there, and it works on 
both linux and solaris. What compiler did you use?

> nagios# ./getnagioscfg nagios.cfg
> Entering /usr/local/nagios/etc/servers. 1 levels deep now
> Entering /usr/local/nagios/etc/servers/test_dir. 2 levels deep now
> returning to /usr/local/nagios/etc/servers
> returning to /usr/local/nagios/etc
> Entering /usr/local/nagios/etc/templates. 1 levels deep now
> returning to /usr/local/nagios/etc
> Segmentation fault (core dumped)
> 
> nagios# ./getnagioscfg /usr/local/nagios/etc/nagios.cfg 
> Entering /usr/local/nagios/etc/servers. 1 levels deep now
> Entering /usr/local/nagios/etc/servers/test_dir. 2 levels deep now
> returning to /usr/local/nagios/etc/servers
> returning to /usr/local/nagios/etc
> Entering /usr/local/nagios/etc/templates. 1 levels deep now
> returning to /usr/local/nagios/etc
> Segmentation fault (core dumped)
> 
> I have attached the core file to this email. Once again, I appreciate all of 
> your help.
> 

Unfortunately, corefiles by themselves are fairly useless. Could you do 
a backtrace and email the results to me off-list?

gdb getnagioscfg core
(gdb) bt
<.... output.... >
(gdb) quit

Cheers.

> best rgds,
> 
> jbiskofski
> 
> On 6/10/05, Andreas Ericsson <ae at op5.se> wrote:
> 
>>Demetri Mouratis wrote:
>>
>>>On Thu, 9 Jun 2005, Subhendu Ghosh wrote:
>>>
>>>
>>>
>>>>On Thu, 9 Jun 2005, jbiskofski wrote:
>>>>
>>>>
>>>>
>>>>>gents,
>>>>>Ive been having trouble getting nagios to recurse inside a cfg_dir
>>>>>directive. I have read some other posts on this mailing list regarding 
>>
>>the
>>
>>>>>issue, yet none with a solution or an explanation. I'm running 2.0b3 on 
>>
>>a
>>
>>>>>freebsd 4.11 system. I'm having no trouble reading all cfg files inside 
>>
>>a
>>
>>>>>cfg_dir but haven't been able to convince nagios to look any further. 
>>
>>Any
>>
>>>>>clues or insight will be appreciated.
>>>>>best rgds
>>>>>jbiskofski
>>>>>
>>>>
>>>>I don't think recursion through directory tree is supported - just 
>>
>>regular
>>
>>>>files inside listed directories...
>>>
>>>
>>>I can confirm the above. In Nagios 1.2, cfg_dir recursion is not
>>>supported.
>>
>>He's using 2.0b3, so recursion is supposed to be supported.
>>
>>Mr. Original Poster; I've got a C program called getnagioscfg which is
>>known to work according to docs on Linux and Solaris (Nagios won't
>>recurse on solaris either). If you could try it with your nagios.cfg and
>>see if it finds all the configuration files that nagios should
>>(according to docs), you can give me a holler and I'll put priority on
>>implementing it in the Nagios core. You can download it at
>>http://oss.op5.se/nagios/
>>
>>Have fun.
>>
>>--
>>Andreas Ericsson andreas.ericsson at op5.se
>>OP5 AB www.op5.se <http://www.op5.se>
>>Lead Developer
>>
>>
>>-------------------------------------------------------
>>This SF.Net <http://SF.Net> email is sponsored by: NEC IT Guy Games. How 
>>far can you shotput
>>a projector? How fast can you ride your desk chair down the office luge 
>>track?
>>If you want to score the big prize, get to know the little guy.
>>Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
>>_______________________________________________
>>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
>>
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
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