How would you monitor a large list of URLs?

Felipe Ferreira fferreira at osiatis.es
Thu Oct 16 11:25:55 CEST 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20081016/28e567cb/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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=/
-------------- next part --------------
_______________________________________________
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