Event Broker Modules on FreeBSD


#1

Okay. To start off, I am using Nagios 3.2.3 (from ports) on FreeBSD 8.1-RELEASE.

Initially, I thought I was having a problem with just the mklivestatus event broker module, as I would get the following error in nagios.log:

[1296052540] Error: Module '/usr/local/lib/mk-livestatus/livestatus.o' is using an old or unspecified version of the event broker API. Module will be unloaded. [1296052540] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' deinitialized successfully.

I tried for a while to figure out where the problem was, and decided, after I could not find it, to try to debug the module loader. I made the following change to nebmods.c to print out some additional information:

/* check the module API version */
	if (module_version_ptr==NULL) {
			logit(NSLOG_RUNTIME_ERROR,FALSE,"Error: Module '%s' NULL VERSION POINTER\n",mod->filename);
		}
		logit(NSLOG_RUNTIME_ERROR,FALSE,"Error: Module '%s' is using an old or unspecified version of the event broker API. Module will be unloaded.\n",mod->filename);

		neb_unload_module(mod,NEBMODULE_FORCE_UNLOAD,NEBMODULE_ERROR_API_VERSION);

		return ERROR;
	        }[/code]

This then showed that the problem was, not, in fact, a version mismatch, but a NULL version pointer instead, as this now produced the following in nagios.log:

[code][1296058443] Error: Module '/usr/local/lib/mk-livestatus/livestatus.o' NULL VERSION POINTER
[1296058443] Error: Module '/usr/local/lib/mk-livestatus/livestatus.o' is using an old or unspecified version of the event broker API. Module will be unloaded.
[1296058443] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' deinitialized successfully.

Then, I tried using the example helloworld module, to see if the problem was limited to mklivestatus…

[1296059465] Error: Module '/usr/ports/net-mgmt/nagios/work/nagios-3.2.3/module/helloworld.o' NULL VERSION POINTER [1296059465] Error: Module '/usr/ports/net-mgmt/nagios/work/nagios-3.2.3/module/helloworld.o' is using an old or unspecified version of the event broker API. Module will be unloaded. [1296059465] Event broker module '/usr/ports/net-mgmt/nagios/work/nagios-3.2.3/module/helloworld.o' deinitialized successfully.

Since I’m using FreeBSD instead of linux, I tried having the module loading code NOT delete the temporary copy of the module it creates… Same error.

Then I tried having it load the module directly from the original file, bypassing the whole temporary-copy stage… same error.

When I completely bypassed the version check logic in the source code, it then progressed to the next step, with the following error:

[1296059951] Error: Could not locate nebmodule_init() in module '/usr/ports/net-mgmt/nagios/work/nagios-3.2.3/module/helloworld.o'.  Module will be unloaded.
[1296059951] Event broker module '/usr/ports/net-mgmt/nagios/work/nagios-3.2.3/module/helloworld.o' deinitialized successfully.

From what I can tell, this is a platform specific problem, and not a problem with event brokers in nagios 3.2.3… any advice or anyone else notice the same problem?