diff --git a/includes/discovery/hr-device.inc.php b/includes/discovery/hr-device.inc.php index ca02047661..f0b1d6b0bd 100755 --- a/includes/discovery/hr-device.inc.php +++ b/includes/discovery/hr-device.inc.php @@ -28,11 +28,11 @@ if(is_array($hrDevices)) $update_query .= ", `hrProcessorLoad` = '".mres($hrDevice[hrProcessorLoad])."'"; } $update_query .= " WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrDevice['hrDeviceIndex']."'"; - @mysql_query($update_query); $mysql++; echo("."); + @mysql_query($update_query); echo("."); } else { $insert_query = "INSERT INTO `hrDevice` (`hrDeviceIndex`,`device_id`,`hrDeviceType`,`hrDeviceDescr`,`hrDeviceStatus`,`hrDeviceErrors`) "; $insert_query .= " VALUES ('".mres($hrDevice[hrDeviceIndex])."','".mres($device[device_id])."','".mres($hrDevice[hrDeviceType])."','".mres($hrDevice[hrDeviceDescr])."','".mres($hrDevice[hrDeviceStatus])."','".mres($hrDevice[hrDeviceErrors])."')"; - @mysql_query($insert_query); $mysql++; echo("+"); + @mysql_query($insert_query); echo("+"); if($debug) { print_r($hrDevice); echo("$insert_query" . mysql_affected_rows() . " row inserted"); } } $valid_hrDevice[$hrDevice[hrDeviceIndex]] = 1; diff --git a/includes/polling/cisco-mac-accounting.inc.php b/includes/polling/cisco-mac-accounting.inc.php index 6ca12db006..b5d3a65979 100755 --- a/includes/polling/cisco-mac-accounting.inc.php +++ b/includes/polling/cisco-mac-accounting.inc.php @@ -58,9 +58,9 @@ while ($acc = mysql_fetch_assoc($mac_accounting_query)) { if($debug) {echo("\n" . $acc['hostname']." ".$acc['ifDescr'] . " $mac -> $b_in:$b_out:$p_in:$p_out ");} $rrdfile = $host_rrd . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"); - if(!is_file($rrdfile)) { - $woo = shell_exec($config['rrdtool'] ." create $rrdfile \ - DS:IN:COUNTER:600:0:12500000000 \ + if(!is_file($rrdfile)) + { + rrdtool_create($rrdfile,"DS:IN:COUNTER:600:0:12500000000 \ DS:OUT:COUNTER:600:0:12500000000 \ DS:PIN:COUNTER:600:0:12500000000 \ DS:POUT:COUNTER:600:0:12500000000 \ @@ -76,9 +76,10 @@ while ($acc = mysql_fetch_assoc($mac_accounting_query)) { $woo = "N:".($b_in+0).":".($b_out+0).":".($p_in+0).":".($p_out+0); $ret = rrdtool_update("$rrdfile", $woo); - if ($update) { /// Do Updates + if ($update) + { /// Do Updates $update_query = "UPDATE `mac_accounting` SET ".$update." WHERE `ma_id` = '" . $acc['ma_id'] . "'"; - @mysql_query($update_query); $mysql++; + @mysql_query($update_query); if($debug) {echo("\nMYSQL : [ $update_query ]");} } /// End Updates unset($update_query); unset($update); diff --git a/includes/polling/hr-mib.inc.php b/includes/polling/hr-mib.inc.php index c0276ab409..9984d7b87b 100755 --- a/includes/polling/hr-mib.inc.php +++ b/includes/polling/hr-mib.inc.php @@ -12,8 +12,7 @@ if(is_numeric($hrSystem[0]['hrSystemProcesses'])) { $rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd"; if (!is_file($rrd_file)) { - shell_exec($config['rrdtool'] . " create $rrd_file \ - --step 300 \ + rrdtool_create($rrd_file,"--step 300 \ DS:procs:GAUGE:600:0:U \ RRA:AVERAGE:0.5:1:800 \ RRA:AVERAGE:0.5:6:800 \ @@ -33,8 +32,7 @@ if(is_numeric($hrSystem[0]['hrSystemNumUsers'])) { $rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd"; if (!is_file($rrd_file)) { - shell_exec($config['rrdtool'] . " create $rrd_file \ - --step 300 \ + rrdtool_create($rrd_file, "--step 300 \ DS:users:GAUGE:600:0:U \ RRA:AVERAGE:0.5:1:800 \ RRA:AVERAGE:0.5:6:800 \ diff --git a/includes/polling/interfaces.inc.php b/includes/polling/interfaces.inc.php index 9f8576d9eb..b2c67fa06f 100644 --- a/includes/polling/interfaces.inc.php +++ b/includes/polling/interfaces.inc.php @@ -66,8 +66,7 @@ while ($interface = mysql_fetch_array($interface_query)) { $rrdfile = $host_rrd . "/" . safename($interface['ifIndex'] . ".rrd"); if(!is_file($rrdfile)) { - $woo = shell_exec($config['rrdtool'] . " create $rrdfile \ - DS:INOCTETS:COUNTER:600:0:12500000000 \ + rrdtool_create($rrdfile,"DS:INOCTETS:COUNTER:600:0:12500000000 \ DS:OUTOCTETS:COUNTER:600:0:12500000000 \ DS:INERRORS:COUNTER:600:0:12500000000 \ DS:OUTERRORS:COUNTER:600:0:12500000000 \ diff --git a/includes/polling/ipSystemStats.inc.php b/includes/polling/ipSystemStats.inc.php index 1886c46104..4b419edd84 100755 --- a/includes/polling/ipSystemStats.inc.php +++ b/includes/polling/ipSystemStats.inc.php @@ -72,8 +72,7 @@ $rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("ipSystemStats-".$af.".rrd"); - $rrd_create = $config['rrdtool'] . " create $rrdfile "; - $rrd_create .= "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797"; + $rrd_create = "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797"; $rrdupdate = "N"; @@ -84,7 +83,7 @@ if(strstr($stats[$oid], "No") || strstr($stats[$oid], "d") || strstr($stats[$oid], "s")) { $stats[$oid] = "0"; } $rrdupdate .= ":".$stats[$oid]; } - if(!file_exists($rrdfile)) { shell_exec($rrd_create); } + if(!file_exists($rrdfile)) { rrdtool_create($rrdfile,$rrd_create); } rrdtool_update($rrdfile, $rrdupdate); unset($rrdupdate, $rrd_create); diff --git a/includes/polling/os/junos.inc.php b/includes/polling/os/junos.inc.php index defde86c0e..57021fa07d 100644 --- a/includes/polling/os/junos.inc.php +++ b/includes/polling/os/junos.inc.php @@ -1,9 +1,11 @@ rrd/version.txt "); + if($argv[1] == "--cron") + { + $fd = fopen('vrrd/version.txt','w'); + fputs($fd, "$major.$minor.$release"); + fclose($fd); } else {