Re: [Nagios-devel] Config from PostgreSQL

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Config from PostgreSQL

Post by Guest »

This is a multi-part message in MIME format.
--------------080105080904080708070307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Maintaining it would not be an issue. The changes would be tracked in a
VCS and upgrades are unlikely, but an alternative (cleaner) approach
would be interesting.

I am brand new to C but have experience with several other languages,
and have never heard of nagios before yesterday. Could you give me a
more newb friendly suggestion to your approach?

I really appreciate the suggestions so far,

Phil Sturgeon

Andreas Ericsson wrote:
> On 12/06/2010 11:41 PM, Phil Sturgeon wrote:
>> I've been charged with a mission a little outside of my usual skillset, and that is to get Nagios 3.2.3 running from config based on a PostgreSQL table instead of the normal cnf_dir setting. I can work out the actual code for this but im struggling to find /where/ it should go.
>>
>> I have only found one instance of cnf_dir in the source and that is here:
>>
>> else if(strstr(input,"cfg_file=")==input || strstr(input,"cfg_dir=")==input)
>> continue;
>>
>> in config.c line 1328. I have no problems hacking the core, but where do I start?
>>
>
> Unless you want to maintain it yourself indefinitely, you don't. You could write
> an eventbroker module that loads the configuration by creating all the hosts
> and services you need though. You'll want the NEBCALLBACK_PROGRAM_STATUS events,
> and the NEBTYPE_PROCESS_START type.
>

--------------080105080904080708070307
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit







Maintaining it would not be an issue. The changes would be tracked
in a VCS and upgrades are unlikely, but an alternative (cleaner)
approach would be interesting.

I am brand new to C but have experience with several other
languages, and have never heard of nagios before yesterday. Could
you give me a more newb friendly suggestion to your approach?

I really appreciate the suggestions so far,

Phil Sturgeon

Andreas Ericsson wrote:

On 12/06/2010 11:41 PM, Phil Sturgeon wrote:


I've been charged with a mission a little outside of my usual skillset, and that is to get Nagios 3.2.3 running from config based on a PostgreSQL table instead of the normal cnf_dir setting. I can work out the actual code for this but im struggling to find /where/ it should go.

I have only found one instance of cnf_dir in the source and that is here:

else if(strstr(input,"cfg_file=")==input || strstr(input,"cfg_dir=")==input)
continue;

in config.c line 1328. I have no problems hacking the core, but where do I start?




Unless you want to maintain it yourself indefinitely, you don't. You could write
an eventbroker module that loads the configuration by creating all the hosts
and services you need though. You'll want the NEBCALLBACK_PROGRAM_STATUS events,
and the NEBTYPE_PROCESS_START type.






--------------080105080904080708070307--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked