Problems with Proxmox API 2, No rrd png file!

Scriptman

New Member
Sep 25, 2010
2
0
1
Hello,

I have made a control panel in PHP.
If I try to fetch the rrd graphs via the proxmox api I get some errors.

Ex:
GET /api2/json/...../rrd?...

Returns:
{"data":{"filename":"/var/lib/rrdcached/db/pve2-vm/101_cpu.png","image":"‰PNG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0003 \u0000\u0000\u0000È\b\u0002\u0000\u0000\u0000Ÿí\u0012M\u0000\u0000\u0000\u0006bKGD\u0000ÿ\u0000ÿ\u0000ÿ ½§“\u0000\u0000 \u0000IDATxœíÝpSu¾ÿñO©(j#µ?€ú\u0003¤ˆ âÏuí ¤R¡ã•ùâȌwg\u0014™ïW´êîÜ .... }

The filepath "filename" doesn't exists. I can only find /var/lib/rrdcached/db/pve2-vm/101.
If i save the "image" variable to a image.png file, the image doesn't display.

I have Proxmox 3.1-3.

Thank you.
 
Hi Scriptman,

I get the same rror as you. image does not exist and PNG returned has errors.
Did you managed to solve the error?

best,
 
Hi Scriptman,

I asked that on the mailing list and I got the answer.

using the function above, you get an utf8 encoded string.

the treatment in php is with utf8_decode()

best
 
Hi Scriptman,

I asked that on the mailing list and I got the answer.

using the function above, you get an utf8 encoded string.

the treatment in php is with utf8_decode()

best


I didn't solve the problem. Thank you very much for sharing! I got it working now, thank you!