From 9881f53e4ae9aba676ad7a2533d3cd806e4f2d2b Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Thu, 3 Dec 2015 15:07:27 +0100 Subject: [PATCH] Do not unset the vars while we're in the loop and upgrade to the new rrdtool_update --- includes/polling/applications/proxmox.inc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/includes/polling/applications/proxmox.inc.php b/includes/polling/applications/proxmox.inc.php index 8e5dc0b90..c1e366b36 100644 --- a/includes/polling/applications/proxmox.inc.php +++ b/includes/polling/applications/proxmox.inc.php @@ -68,7 +68,9 @@ if (count($pmxlines) > 0) { DS:OUTOCTETS:DERIVE:600:0:12500000000 '.$config['rrd_rra']); } - rrdtool_update($rrd_filename, 'N:'.$vmpin.':'.$vmpout); + rrdtool_update($rrd_filename, array("INOCTETS" => $vmpin, "OUTOCTETS" => $vmpout)); + print "Proxmox ($pmxcluster): $vmdesc: $vmpin/$vmpout/$vmport\n"; + if (proxmox_vm_exists($vmid, $pmxcluster, $pmxcache) === true) { dbUpdate(array('device_id' => $device['device_id'], 'last_seen' => array('NOW()'), 'description' => $vmdesc), 'proxmox', '`vmid` = ? AND `cluster` = ?', array($vmid, $pmxcluster)); } @@ -84,10 +86,11 @@ if (count($pmxlines) > 0) { } } - - unset($pmxlines); - unset($pmxcluster); - unset($pmxcdir); - unset($proxmox); - unset($pmxcache); } + + +unset($pmxlines); +unset($pmxcluster); +unset($pmxcdir); +unset($proxmox); +unset($pmxcache);