[Nagiosplug-devel] Kickoff for 1.5
Ton Voon
tonvoon at mac.com
Wed Mar 9 13:01:23 CET 2005
Hmmmm.
On 9 Mar 2005, at 08:38, Andreas Ericsson wrote:
>> - consolidation of duplicate code
>> depending on what we learn from the above two, it might make
>> sense to develop a common code base to reduce code redundancy.
>
> This is an area where much can be gained. The plugin devel api today
> isn't very useful.
>
> For spawning commands, there should be a function that takes as input
> the command line, and returns the output and return code of the
> command. This would accomplish much and get rid of a LOT of duplicate
> code in the plugins.
>
> For snmp, there should be a function that takes a snmp_auth struct
> (which needs to be invented) and a list of oid's to fetch, and then
> returns the values of those oid's in an array.
Good idea. In the general case, common code base is a good goal.
> For argument parsing, the getopt_long function might be all good and
> well, but it's behaviour on various systems is undocumented (some
> break parsing on first non-option argument, other reorder nonopts to
> be last and just keep going).
This is just plain wrong. We use getopt.c from the GNNU coreutils
project. We ignore any system implementations of getopt. If you find
something wrong, I'll be happy to accept a patch and I will also push
it upstream to the GNU coreutils project. But, without a patch or an
accurate bug report, I am taking your opinions with a huge pinch of
salt.
> I've written a function which takes identical input and is fully
> compatible in simple parsing but handles non-option arguments
> identically on all systems (by populating a linked list of strings).
> It also has support for obscuring sensitive arguments, such as
> usernames and passwords.
Interesting idea, especially obscuring sensitive arguments. Patch? I'm
sure GNU coreutils may be interested.
> Lately I've become fed up with the official plugin distribution. The
> number of distributed bugs in allegedly stable releases is just too
> much work to sort out, so I've started hacking up my own framework
> into which I'll import the current plugins whith changes as necessary.
I don't think this is a very productive comment. You work in a company
that sells Nagios so you can spend all your company time on our
software. The rest of us do it while we get on with life.
Ton
More information about the Devel
mailing list