[rrd-users] Weird values when updating in a PHP script
Yann Bizeul
ml at tynsoe.org
Mon Dec 26 15:52:37 MET 2005
WAS : Can't figure out the good RRD config
------------------------------------------
What can cause a difference between updating a DB in a PHP script, or
a shell script ?
In my php script I do :
$fp = fopen("/tmp/update.sh","a");
$t = time();
fwrite($fp,"/usr/bin/rrdtool update /var/www/sites/yann/
www.tynsoe.org/paypal/updates.rrd -t queries " . $t . ":".$db->f(0) .
"\n");;
fclose($fp);
rrd_update("/var/www/sites/yann/www.tynsoe.org/paypal/updates.rrd",
$t . ":" . $db->f(0));
In other words, I feed a .sh file used to re-feed my DB if it gets
corrupted, and with the same values, I update the rrd database using
php-rrdtool PHP extensions.
After some values are fetched, the database gets corrupted with very
high values I never fed, like this :
1135605000: 1.3289036545e-02
1135605300: 8.8593576966e-05
1135605600: 9.9335548173e-03
1135605900: 1.3355185428e-02
1135606200: 4.4593088071e-05
1135606500: 0.0000000000e+00
1135606800: 6.6444444444e-03
1135607100: 6.6445921004e-03
1135607400: 6.6886669111e-03
1135607700: 6.6667409885e-03
1135608000: 2.2222222222e-05
1135608300: 1.4316476199e+07 <-- HERE !
1135608600: 1.4316623511e+07
1135608900: nan
Then if reset the DB and run my script :
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135604701:500966
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135605002:500970
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135605301:500970
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135605602:500973
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135605901:500977
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135606201:500977
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135606501:500977
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135606801:500979
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135607102:500981
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135607401:500983
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135607701:500985
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135608001:500985
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135608302:500987
/usr/bin/rrdtool update /var/www/sites/yann//www.tynsoe.org/paypal/
updates.rrd -t queries 1135608601:500988
I get normal values again :
1135605000: 1.3289036545e-02
1135605300: 8.8593576966e-05
1135605600: 9.9335548173e-03
1135605900: 1.3355185428e-02
1135606200: 4.4593088071e-05
1135606500: 0.0000000000e+00
1135606800: 6.6444444444e-03
1135607100: 6.6445921004e-03
1135607400: 6.6886669111e-03
1135607700: 6.6667409885e-03
1135608000: 2.2222222222e-05
1135608300: 6.6223698782e-03 <-- OK !
1135608600: 3.3664818498e-03
1135608900: nan
Any idea ?
Yann Bizeul • yann at tynsoe.org
Cocoa Developer
Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...
http://projects.tynsoe.org/
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list