A couple of Nagios NEB plugin API questions

Razvan Cojocaru razvan.cojocaru at 1and1.ro
Thu Aug 9 12:16:01 CEST 2012


> Well, the individual members are fairly self-explanatory, don't you
> think? Ethan's big on mnemonic names, and for a very good reason.

Yes, you can glean what they're for from their names, but that's not
what I was asking. It's one thing to know that a field called "flags"
should probably be set to some OR-ed or AND-ed bits, and quite another
to know what those bits should be or what behaviour they will trigger,
for example.

And you can't quite glean even that much about what a void *object_ptr
does or means.

I'll figure out what the docs don't say by reading the code.


> You might want to check out some module and use as example though.
> mod_gearman provides a good resource, as does NDOUtils and Merlin.
> Livestatus is pretty nifty, but unless you're mentally equipped to
> follow the tons and tons of C++ boilerplate I advise against using
> it as anything but an excellent backend to your data.
> 
> At http://git.op5.org/git/?p=nagios/merlin.git;a=summary you'll
> find the merlin source-code. If you're not git-literate you might
> want to download a snapshot. "module.c" and "hooks.c" has most of
> the code that handles nebstruct type objects.

I'm already going that route, and yes, I am git-literate. Thanks for the
suggestions! I didn't get to Merlin yet.


>> broker_module=/usr/local/nagios/bin/testmodule.o
>> config_file=/usr/local/nagios/etc/testmodule.cfg
>>
>> How does one access that configuration data from within the plugin? Via
> 
> It's the "char *" argument to your module's nebmodule_init() function.

Thanks! But the "char *" argument of nebmodule_init() passes the
"command line arguments" for the module, i.e.:

broker_module=/usr/local/nagios/bin/testmodule.o arguments

However, I was asking about accessing data written in a regular Nagios
.cfg file. The article I've quoted clearly implies that this can be
done; it's possible that they're wrong, but if they're not, I'd like to
know "extern whattype* what" gives me access to the parsed Nagios
configuration data.


Thanks,
-- 
Razvan Cojocaru

Linux Development Core Romania

1&1 Internet Development S.R.L. - Bucharest/Romania
Web: www.1und1.de


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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