Hi,
I have a script which is run from cron and parses some xml for stats to pass to zabbix via zabbix_sender. The script works but I'm seeing some updates fail:
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.001578"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.001366"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000040"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000043"
My code that does the inserts looks like this:
foreach($sender_data[$host] as $key=>$value) {
if (ZabbixItem::apiObjExists('item',array('key_'=>$ke y,'host'=>$host))) {
shell_exec("$zabbix_sender -c $zabbix_agent_cfg -s $host -k $key -o $value 2>&1 >> $LOGPATH");
}
else {
shell_exec("echo Item update failed for $host:$key. Item key not found.\n 2>&1 >> $LOGPATH");
}
}
Are my updates failing because I'm processing the updates via a loop? What is the recommended method for bulk loading significant numbers of stats?
Regards,
David
I have a script which is run from cron and parses some xml for stats to pass to zabbix via zabbix_sender. The script works but I'm seeing some updates fail:
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.001578"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.001366"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000040"
sent: 1; skipped: 0; total: 1
Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000043"
My code that does the inserts looks like this:
foreach($sender_data[$host] as $key=>$value) {
if (ZabbixItem::apiObjExists('item',array('key_'=>$ke y,'host'=>$host))) {
shell_exec("$zabbix_sender -c $zabbix_agent_cfg -s $host -k $key -o $value 2>&1 >> $LOGPATH");
}
else {
shell_exec("echo Item update failed for $host:$key. Item key not found.\n 2>&1 >> $LOGPATH");
}
}
Are my updates failing because I'm processing the updates via a loop? What is the recommended method for bulk loading significant numbers of stats?
Regards,
David
Comment