[Nagiosplug-devel] [PATCH] check_dns: added 'expected address' param
Subhendu Ghosh
sghosh at sghosh.org
Mon Oct 7 12:08:08 CEST 2002
Took a quick look at the patch - everything looks ok - except that I
would change the is_host() in the arg validation to is_dotted_quad().
is_host will also accept a hostname and I think your intentions were to
only accept a IP address (IPv4 for now.)
-sg
On Mon, 7 Oct 2002, Alex Chaffee / Purple Technology wrote:
> I patched check_dns.c to take another optional parameter. If you
> specify "-a 12.34.56.78" then (assuming everything else worked ok too)
> it compares the returned address to the parameter. If they do not
> match, it fails with CRITICAL.
>
> Should it be a WARNING instead? I'm not familiar with Nagios
> conventions as to what counts as serious enough to be CRITICAL. I'm
> thinking, if it matters that the service is running, use the normal
> check_dns; if you go out of your way to test the returned address,
> then it's important enough to you to count as a CRITICAL. But I could
> be wrong.
>
> I used -a and --expected-address as the parameter name.
>
> Here's a template-style command for the new calling style. I'm not
> sure what file in the project this should go into. (It seems that
> command.cfg needs to be converted into the new template style...)
>
> # check_dns_address!hostname-to-check!expected-ip-address
> # example: check_dns_address!myhost.foo.com!123.45.67.89
> define command{
> command_name check_dns_address
> command_line $USER1$/check_dns -s $HOSTADDRESS$ -H $ARG1$ -a $ARG2$
> }
>
> A patch file is attached to the patch report at
> http://sourceforge.net/tracker/index.php?func=detail&aid=619800&group_id=29880&atid=397599
>
> Forgive my sloppy C -- it's been a while :-)
>
> - A
>
>
--
More information about the Devel
mailing list