[PHP] Log parsing

2004-08-14 Thread Watty
I have a dynamic IP address, I used everydns.net as a DNS server. I have a bash script that runs with cron that checks the current IP of the machine with the DNS record so that if my IP changes; it can run the update program. I would like to do some thorough availability reports, so I started by

Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
Watty wrote: I have a dynamic IP address, I used everydns.net as a DNS server. I have a bash script that runs with cron that checks the current IP of the machine with the DNS record so that if my IP changes; it can run the update program. I would like to do some thorough availability reports, so

Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
Watty wrote: I would like to do some thorough availability reports, so I started by writing the result of the bash script to a log file. I want to parse the log file to give me availability reports. The log file is in the form: 08/14/04 09:10:01 [TAB] S - when the IP

RE: [PHP] Log parsing

2004-08-14 Thread Watty
into the log when the computer shuts down. Watty -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: 15 August 2004 01:52 To: Watty Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Log parsing Watty wrote: I would like to do some thorough availability reports, so I started

Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
John Holmes wrote: Watty wrote: We know because the IP check run every 5 minutes by cron, and if it has no run within 5:01 minutes then the computer is off, or the script isn't working. But we should assume that the computer is off is there is not a record for that 5 minute slot.

RE: [PHP] Log parsing

2004-08-14 Thread Watty
PROTECTED] Subject: Re: [PHP] Log parsing Watty wrote: I would like to do some thorough availability reports, so I started by writing the result of the bash script to a log file. I want to parse the log file to give me availability reports. The log file is in the form: 08/14/04 09:10:01

RE: [PHP] Log parsing

2004-08-14 Thread Watty
I'll try that in another way; feel free to give me your hacks for it: ?php $file = file_get_contents( ./ip ); $line = explode( \n, $file ); ## Number of log entries $total = 0; $unavail = 0; $unavaillog = FALSE; ## Establish the standard difference between log entries of 5 minutes $diff =