RE: [PHP] Uptime script

From: Date: Tue, 07 Aug 2001 02:33:15 +0000
Subject: RE: [PHP] Uptime script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61536@lists.php.net to get a copy of this message
At 07.08.2001 03:19, Craig Westerman wrote:
Does anyone here have a script to run uptime every ten minutes or so, log output, then display daily output in a nice friendly chart?
Seems a bit daft running it every ten minutes, as a server should be up 24/7, how do you plan to check it otherwise? I'm wanting to chart the server load average data displayed when you run uptime not how many days it has been running. %uptime 6:10PM up 321 days, 6:59, 3 user, load averages: 0.20, 0.16, 0.15 %uptime 6:19PM up 321 days, 7:08, 3 user, load averages: 0.15, 0.16, 0.16 %uptime 10:15PM up 321 days, 11:04, 3 user, load averages: 0.19, 0.24, 0.22
The correct way to do that would be to read it straight from the source, (eg. /proc/loadav for linux with procfs). That would be much quicker, and it would also save your server a fork for each reading (unless you are running php as a cgi ;-) nice uptime btw... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.

« previous php.general (#61536) next »