[Nagios-devel] [PATCH] - 3.0.3 / 3.2.0 - enhanced diagnostic output

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

[Nagios-devel] [PATCH] - 3.0.3 / 3.2.0 - enhanced diagnostic output

Post by Guest »

Hi,

For Nagios 3.0.3 and 3.2.0.

http://github.com/netoisstools/Nagios-3 ... te.c.patch

Patched to provide better diagnostic output when a regular expression
compile (regcomp()) in xodtemplate.c fails.

Example output post-patch for a file file.cfg with a hostgroup line of

hostgroups +my_correct_additive_group,another_group,+my_host_group

Error: Invalid regular expression '+my_host_group' found while
expanding host group names in file '/path/to/file.cfg' starting on
line 23. NOTE: regex could be inherited from a template in a
different file.

The largest value in this patch is shown in the case above .. when
use_regexp_matching is set to 1 in nagios.cfg and someone accidentally
puts an additive inheritence '+' sign in the middle of a line instead
of at the beginning of a line. Without the patch a generic 'error occured'
error message is shown with no file reference etc. I put the "NOTE*
section in place as I did find that by the time the regular expression
compilation is done template inheritence had been completed and so the
invalid regular expression could have come from a different template
... but at least the user knows which object definition triggered it,
which regular-expresasion enabled attribute triggered it, and in which
file, which for us has made the process of tracking down invalid '+'s
in inheritable attribute lines a 1-2 minute process instead of the
30-45+ minute plus time it used to take us before the patch.

Special thanks to our managers at Comcast - Eric Scholz, Mike Fischer,
and Jason Livingood, for allowing us to contribute our work on Nagios
back to the Nagios community.

- Max





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