#!/usr/bin/php -q 0) { foreach ($polling_items as $item) { switch ($item["action"]) { case '0': /* snmp */ $output = cacti_snmp_get($item["management_ip"], $item["snmp_community"], $item["arg1"], $item["snmp_version"], $item["snmp_username"], $item["snmp_password"]); print "snmp: " . $item["management_ip"] . ", dsname: " . $item["rrd_name"]. ", oid: " . $item["arg1"] . ", value: $output\n"; break; case '1': /* one output script */ $command = $item["command"]; $output = `$command`; print "command: $command, output: $output\n"; $data_input_field = db_fetch_row("select id,update_rra from data_input_fields where data_input_id=" . $item["data_input_id"] . " and input_output='out'"); if ($data_input_field["update_rra"] == "") { /* DO NOT write data to rrd; put it in the db instead */ db_execute("insert into data_input_data (data_input_field_id,data_template_data_id,value) values (" . $data_input_field["id"] . "," . db_fetch_cell("select id from data_template_data where local_data_id=" . $item["local_data_id"]) . ",'$output')"); $item["rrd_name"] = ""; /* no rrd action here */ } break; case '2': /* multi output script */ $command = $item["command"]; $output = `$command`; print "MUTLI command: $command, output: $output\n"; $output_array = split(" ", $output); for ($i=0;($i