Elasticsearch + Kibanaでサーバのリソース監視

dstatでCPU使用率, メモリ, スワップ, ネットワークI/O, ディスクI/Oなどを取得してfluentdでElasticSearchに投げつけるというものです. それをKibanaで視覚化します. ElasticSearch + Kibana + fluentd + dstatのやり方については他に紹介してるWebサイトがたくさんあるので割愛します. dstatだかfluentdのdstatプラグインの仕様が変わっているだかで, 参考にしたWebサイトの設定ファイルでは動きませんでした. ということで修正した fluentd.conf を紹介します. fluent.conf <source> type config_expander <config> type dstat tag host.dstat.__HOSTNAME__ option -tclmsgr -dD sda,sdb --disk-util -nN eth0 delay 10 </config> </source> <match host.dstat.**> type copy <store> type map map '["map." + tag + ".cpu_usr", time , "cpu_usr" => record["dstat"]["total_cpu_usage"]["usr"]]' </store> <store> type map map '["map." + tag + ".cpu_sys", time , "cpu_sys" => record["dstat"]["total_cpu_usage"]["sys"]]' </store> <store> type map map '["map....

2016/06/26 · 3 分 · 457 文字 · Me