Re: network monitoring script ...help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First of all, you should post scripts without special characters.

Change this line

for host in `awk '/^[0-9]/ { print $1 }' /home/jk/nethost`

To:
for host in `cat /home/jk/nethost`


On 17 June 2010 07:28, Jatin K <ssh.fedora@xxxxxxxxx> wrote:
>
> Hi all
>
> I've got the following[1] script from the Internet ( by googling )....
> but it is not working :-(
>
> can anyone tell me what is wrong with it ????
>
> [1]------------------
> #!/bin/sh
>
> for host in `awk '/^[0-9]/ { print $1 }' /home/jk/nethost`
> do
>        echo "Checking $host: \c"
>        ping $host 1 2>&1 | \
>           sed 's/.*no answer.*/[31;1m&[0m/;s/.*is alive.*/[32;2m&[0m/'
> done
>
> --------------------------
>
> the output of "cat /home/jk/nethost" is as under
>
> 172.16.10.1
> 172.16.20.1
> 172.16.30.1
> 172.16.40.1
> 172.16.50.1
> 172.16.60.1
> 172.16.70.1
> 172.16.80.1
>
> ------------------------------------------
>
> Regards
>
> --
>   °v°
>  /(_)\
>   ^ ^  Jatin Khatri
> Registerd Linux user No #501175
> www.counter.li.org
> No M$
>
> --
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux