17. 障害時イベントのロストを防止
• Zabbixが動作不能になった場合の対策
– アクティブエージェントはその間のデータをバッファ保持する
• Agentのバッファサイズを拡張
– /etc/zabbix/zabbix_agentd.conf “BufferSize”
– デフォルト100→65535(最大値)
– 1時間以上のダウンでも問題ないことを確認した
### Option: BufferSize
# Maximum number of values in a memory buffer. The agent will send
# all collected data to Zabbix Server or Proxy if the buffer is full.
#
# Mandatory: no
# Range: 2-65535
# Default:
# BufferSize=100
BufferSize=65535 →バッファサイズを最大に変更
23. 追記:Zabbixでもトレンド情報は
平均値でサンプル感覚を圧縮され
ます。この記述は、「Zabbixでは
生のデータを使って加工できるの
レポート出力 でイイね!という意味合いで捉え
てください。特定の製品をDisる内
容ではありません。
• 他のツールと違い、性能情報はサマリ化せずに蓄積され
る
– あとからレポート加工する際に生データをそのまま加工できるので都
合が良い
• データが圧縮されないので、保存期間の検討は重要
– 今回はSQL抽出する運用と相まって、比較的短期間(90日分)のデー
タ保存とした
mysql -urhogeoot -pwdhogehoge zabbix -e "select concat(substr(from_unixtime(history.clock),1,15),'0') as 時間, hosts.host as 'ホスト名',(100 - min(history.value)) as 'CPU
使用率' from history,items,hosts where history.itemid = items.itemid and hosts.hostid=items.hostid and items.key_ = 'system.cpu.util[,idle,avg1]' and
from_unixtime(history.clock) like 'yyyy-MM-dd%' group by hosts.host,substr(from_unixtime(history.clock),1,15) order by
substr(from_unixtime(history.clock),1,15),hosts.host;" > /home/ad@@@@@@/cpu_yyyy-MM-dd.txt
※@@@@@@・・・自分のユーザーID yyyy-MM-dd・・・前日日付へ置換