Linux.com

chestbrah

chestbrah

  • Linux.com Member
  • Posts: 3
  • Member Since: 26 Feb 12
  • Last Logged In: 06 Mar 12

Latest Posts

Posted by
Topic
Post Preview
Posted
  • chestbrah
    RE: linux code help
    Yes, it is one ip per line. Timestamp can infront of the output. This is the code without the date. it works fine but no date. I tried to attach the config file but it is not supported. if ($1) then echo "Argument not found: Usage: script filename.conf" exit else awk '{print "ping -i " $2 " " $1 " &"}' $1 | sh fi | tee -a monitoring.log wait Configuration file: youtube.com 15 yahoo.com 777.777.777.777 15 129.219.110.112 30 999.999.999.999 30
    Link to this post 28 Feb 12

    Yes, it is one ip per line. Timestamp can infront of the output.

    This is the code without the date. it works fine but no date. I tried to attach the config file but it is not supported.
    if ($1)
    then
    echo "Argument not found: Usage: script filename.conf"
    exit
    else
    awk '{print "ping -i " $2 " " $1 " &"}' $1 | sh
    fi | tee -a monitoring.log
    wait

    Configuration file:

    youtube.com 15
    yahoo.com

    777.777.777.777 15

    129.219.110.112 30

    999.999.999.999 30

  • chestbrah
    RE: linux code help
    I am supposed to read from a configuration while with a list of ip addresses and then ping those to see if they are reachable or not. I also need to add a timestamp for the results.
    Link to this post 27 Feb 12

    I am supposed to read from a configuration while with a list of ip addresses and then ping those to see if they are reachable or not. I also need to add a timestamp for the results.

  • chestbrah
    linux code help
    if ($1) then echo "Argument not found: Usage: script filename.conf" exit else date | awk '{print "ping -i " $2 " " $1 " &"}' $1 | sh fi | tee -a monitoring.log wait i tried to add a timestamp (date) to the code but its not working.
    Link to this post 26 Feb 12

    if ($1)
    then
    echo "Argument not found: Usage: script filename.conf"
    exit
    else
    date | awk '{print "ping -i " $2 " " $1 " &"}' $1 | sh
    fi | tee -a monitoring.log
    wait

    i tried to add a timestamp (date) to the code but its not working.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board