matt2kjones
02-09-2003, 09:52 AM
hmmmm i have recently made a server status page : http://www.thedigitaldream.co.uk/server_status.php
but i want to add more there
im gunna add the uptime today
but what i want to do is this
if you go here: http://www.thedigitaldream.co.uk/data_transfer.php
now, all i want from there is the in/out bytes of eth0
so is this the best way of going about it
opening the file using file(); and storing it in an array
the moving straight to the 3rd line
then, to pin point the numbers, have my script count the spaces between the numbers so it knows where it is on the file.
the first part is easy
eth0:1814366492
all i have to do is remove eth0:
but then, then the out bandwidth is harder to get. so i was going to count the gaps, there are 8, which will put me before the out bandwidth.
is that the best way to do it???
or is there a really easy way to go around this?
Thanx
but i want to add more there
im gunna add the uptime today
but what i want to do is this
if you go here: http://www.thedigitaldream.co.uk/data_transfer.php
now, all i want from there is the in/out bytes of eth0
so is this the best way of going about it
opening the file using file(); and storing it in an array
the moving straight to the 3rd line
then, to pin point the numbers, have my script count the spaces between the numbers so it knows where it is on the file.
the first part is easy
eth0:1814366492
all i have to do is remove eth0:
but then, then the out bandwidth is harder to get. so i was going to count the gaps, there are 8, which will put me before the out bandwidth.
is that the best way to do it???
or is there a really easy way to go around this?
Thanx
