Unnecessary host_name and for type loops/multiple check_commands?

Kelly Jones kelly.terry.jones at gmail.com
Mon Apr 2 02:14:34 CEST 2007


Thanks to everyone who suggested nagios-- I have now started using
it... so here come the newbie questions...

I'm paranoid that someone will attack my DNS providers, so I want to
confirm my hostnames look up correctly. I wrote this command:

; this is different from check_dns
define command {
 command_name confirm_dns
 command_line check_dns $ARG1$ -s 63.226.12.96 -a $ARG2$
}

which confirms that a given hostname resolves to a given address using
the public DNS server 63.226.12.96.

Here's one service that checks this:

define service {
 use service-defaults ; just a bunch of trivial defaults
 service_description DNS-HOST1
 host_name localhost
 check_command confirm_dns!host1.mycompany.com!1.2.3.4
}

My questions:

% Is "host_name localhost" really necessary here? There's no reference
to $HOSTADDRESS$ anywhere in confirm_dns, but if I don't define
"host_name", nagios complains.

% I want to check about 20 hostnames.

 % Any shortcut to writing 20 6-line "service" definitions?
 % Can I use a for loop or something?
 % Use multiple check_command's in a single service (doesn't seem to to work)?

Of course, I can write a Perl one-liner or something to populate the
config file, but that seems kludgey. Having looping behavior in the
config file directly would be really useful for other reasons too.

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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