send ping and log result to file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • georgios zakitraxis

    send ping and log result to file

    Hello,

    I want to have a php script which pings a host with ping 1.1.1.1 -t all the
    time and it shoukld write these things to a logfile.
    When it comes like "timout exceeded" it should write this only once to a
    file. Because if timout is 2000 times I don't want to have timeout exceeded
    200 times in a database.
    But when ping times are coming they should be logged in a file with date and
    time when the ping accured.

    Is this possible? - if yes, how?

    Thanks
  • Janwillem Borleffs

    #2
    Re: send ping and log result to file

    georgios zakitraxis wrote:[color=blue]
    > Is this possible? - if yes, how?
    >[/color]

    Some things are better handled by the system. Just run the job on the
    background, e.g.:

    $ ping 1.1.1.1 -t > /ping.log &


    JW



    Comment

    Working...