From: <rou...@cs...> - 2006-12-25 01:28:30
|
Hello: I have the following two lines in nagios.cfg (lines split for readability): broker_module=/usr/lib/nagios/modules/ext_corr.o --file /tmp/sampler.2 --tag module2 --control ops01;ZSecControl broker_module=/usr/lib/nagios/modules/ext_corr.o --file /tmp/sampler --tag module1 --control ops01;ZSecControl This is meant to create two identical feeds of data from the module. However only the first one seems to generate output. In the case above, only the file /tmp/sampler (module1) receives events. /tmp/sampler doesn't get any output. If I reverse the order of the entries, then /tmp/sampler is the only file to receive output from the module. The log messages: [1167001096] Nagios 2.6 starting... (PID=17742) [1167001096] LOG VERSION: 2.0 [1167001096] ext_corr: module loading for --file /tmp/sampler --tag module1 --control ops01;ZSecControl: $Id$ - uses open [1167001096] Event broker module '/usr/lib/nagios/modules/ext_corr.o' initialized successfully. [1167001096] ext_corr: module loading for --file /tmp/sampler.2 --tag module2 --control ops01;ZSecControl: $Id$ - uses open [1167001096] Event broker module '/usr/lib/nagios/modules/ext_corr.o' initialized successfully. seem to indicate that both are properly loaded and initalized. However the funny part is that they are loaded in the reverse order from that specified in the config file. I added the following code to the beginning of ext_corr.o:processCallback(): snprintf(temp_buffer,sizeof(temp_buffer)-1,"ext_corr[%s]: callback activate\ d\n", tag); temp_buffer[sizeof(temp_buffer)-1]='\x0'; write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE); and this reports that only the module2 instance is receiving events/being called. Is there some reason that multiple instances of a module can't register? Also attempting to shut down nagios hangs and it has to be given a kill -9 to exit. Hmm, on further investigation I can copy ext_corr.o to ext_corr1.o and change the broker_module lines above and get output to both module1 and module2. Also the debugging code shows both modules are being called (as expected) and exiting nagios no longer hangs. So is this intentional? If so it is documented anywhere? This is with nagios 2.6 plus a couple of patches that add the event type that the modules register for. -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions. |