If your problem is the pain to add one by one by hand. I would
write a script that would pull a list of the urls,hosts,IP from a text file and generate a hosts.cfg file, that should speed up things.I also advise to first create templates of Hosts,and Services...
I use this script to parse 3 args CSV files like,
Hostname,Info(Alias),IP You could adjust as you would like...
*
->hosts.sh script:*

   #!/bin/sh
   #SCRIPT TO MAKE A HOST.CFG list
   #By Felipe Ferreira 09/10/2008 version 2.0

   file=$1
   echo "Nombre del Script: $0?;
   echo "Nombre del Host.txt : $file";
   cat $file |while read line;
   do
   echo "${line}"
   NAME=`echo ${line}|cut -d, -f1`
   INFO=`echo ${line}|cut -d, -f2`
   IP=`echo ${line}|cut -d, -f3`
   cat hosts.skel | sed -e "s/NAME/$NAME/" -e "s/INFO/$INFO/" -e
   "s/IP/$IP/">>hosts.cfg
   done
   #clean Illegal Chars
   cat hosts.cfg | sed -e "s/ç/c/" -e "s/é/e/" -e "s/è/e/" -e "s/ó/o/"
   -e "s/ò/o/" -e "s/à/a/" -e "s/´/_/" -e "s/í/i/" -e "s/ú/u/" -e
   "s/'/_/" >>hostsCLEAN.cfg

***You will also need a hosts.skel file like this:*

   define host{
   host_name Loopback_NAME
   use Routers-Dix
   alias INFO
   address IP
   hostgroups DIx_Loopback
   }


Sorry for the long post, I do have it better explained here:
http://felipeferreira.net/?p=48


--
*Felipe Ferreira*
www.felipeferreira.net
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to