0) { foreach ($polling_items as $item) { switch ($item["action"]) { case '0': /* snmp */ $output = cacti_snmp_get($item["management_ip"], $item["snmp_community"], $item["arg1"], "", $false); print "snmp host: " . $item["management_ip"] . ", oid: " . $item["arg1"] . ", value: $output\n"; break; case '1': /* one output script */ $command = get_full_script_path($item["local_data_id"]); $output = `$command`; print "command: $command, output: $output\n"; break; case '2': /* multi output script */ break; } $update_cache_array{$item["local_data_id"]}{$item["rrd_name"]} = trim($output); rrdtool_function_create($item["local_data_id"], false); } } rrdtool_function_update($update_cache_array); //print_r($update_cache_array); /* dump static images/html file if user wants it */ if (read_config_option("path_html_export") != "") { if (read_config_option("path_html_export_skip") == "1") { include("export.php"); }else{ if (read_config_option("path_html_export_skip") == read_config_option("path_html_export_ctr")) { mysql_query("update settings set value=1 where name=\"path_html_export_ctr\"", $cnn_id); include("export.php"); }else{ if (read_config_option("path_html_export_ctr") == "") { mysql_query("update settings set value=1 where name=\"path_html_export_ctr\"", $cnn_id); }else{ mysql_query("update settings set value=" . (read_config_option("path_html_export_ctr") + 1) . " where name=\"path_html_export_ctr\"", $cnn_id); } } } } ?>