Thanks so much.rkennedy wrote:Sounds good - let us know if you need any further assistance!
I just wish there was a clearer way to have what I had outlined that can be put into use.
Thanks so much.rkennedy wrote:Sounds good - let us know if you need any further assistance!
rkennedy wrote:From what I understand, you just want a host check using ping only - is that right?
To help you better understand, I wrote this post out on Monday. It gives a pretty good explanation on how things correlate (although not related to what you're asking, it may help understand core a bit more). https://support.nagios.com/forum/viewto ... 30#p175559
Code: Select all
#!/bin/sh
COUNTER=1
while [ $COUNTER -lt 5001 ]
do
DOMAIN=$(sed "${COUNTER}q;d" domains.txt)
echo "define host {" > $DOMAIN.cfg
echo " use linux-server" >> $DOMAIN.cfg
echo " host_name $DOMAIN" >> $DOMAIN.cfg
echo " alias $DOMAIN Alias Monitoring" >> $DOMAIN.cfg
echo " address $DOMAIN" >> $DOMAIN.cfg
echo " max_check_attempts 5" >> $DOMAIN.cfg
echo " check_period 24x7" >> $DOMAIN.cfg
echo " notification_interval 30" >> $DOMAIN.cfg
echo " notification_period 24x7" >> $DOMAIN.cfg
echo " contact_groups admins" >> $DOMAIN.cfg
echo "}" >> $DOMAIN.cfg
echo $COUNTER
COUNTER=$(( $COUNTER + 1 ))
done
Code: Select all
google.com
yahoo.com
bing.com
Code: Select all
cfg_dir=/usr/local/nagios/etc/genconfigs
eLoyd - I think you've already have earned that titleeloyd wrote:Nagios likes to be statically defined for each host so it can maintain history information, rather than dynamically choosing things from a list to check. Honestly, if you have some script-writing-fu or someone around you has some Excel variable concatination-fu, you could write something that simply exports that Excel data as a CSV file, and import it into your script and have the script create a giant hosts definition file for you.
In fact, if you PM me the CSV file with IP addresses and names of machines, I'd be happy to do it for you if you remember to vote for me for a Nagios MVP award when the time comes.