Ping a server and fetch a 'clean' result
Posted: Fri Jul 09, 2010 4:55 pm
Hi,
Yes, somewhat new in PHP - so please bare with me.
What I am trying to do is to make a script which pings some IPs X times every Y minutes, and pick up the result and store it in a database. The part about getting the IPs to ping from a list (database), doing it every Y minutes (cron job) and getting it stored in a database - those parts I can handle. What I cannot figure out how to do is this:
Ping from PHP and pick up the result and then store it (timestamp, IP, and time in ms) in an array.
Can someone please help me on this?
Thanks a lot!!
//Anders
Yes, somewhat new in PHP - so please bare with me.
What I am trying to do is to make a script which pings some IPs X times every Y minutes, and pick up the result and store it in a database. The part about getting the IPs to ping from a list (database), doing it every Y minutes (cron job) and getting it stored in a database - those parts I can handle. What I cannot figure out how to do is this:
Ping from PHP and pick up the result and then store it (timestamp, IP, and time in ms) in an array.
Can someone please help me on this?
Thanks a lot!!
//Anders