ELK Stackでシステム監視 collectdでNTPサーバの情報収集

collectdゑ佾ぢづペジデね惄堰ゑ雅むりねどよっぃてなNTPゴ・ハねoffsetゃdelayどとね惄堰め雅むぞぃでぃぅねのぁりおで怜ぅ。

ぃっめFreeBSDはおらどねて仉囝のdebian糺ねLinuxねペジデなcollectdゑ兤るりでげれおよ。

collectdねィヲジデ・リ

# apt-get update    ← バヂグ・シ閡俁ね惄堰曳斯
# apt-cache search collectd       ←collectdバヂグ・シゑ椛紡
collectd - statistics collection and monitoring daemon   ←げるゑ兤るぞぃ
collectd-core - statistics collection and monitoring daemon (core system)
collectd-dbg - statistics collection and monitoring daemon (debugging symbols)
collectd-dev - statistics collection and monitoring daemon (development files)
collectd-utils - statistics collection and monitoring daemon (utilities)
libcollectdclient-dev - client library for collectd's control interface (development files)
libcollectdclient1 - client library for collectd's control interface
fedmsg - Fedora messaging infrastructure system - general utilities
kcollectd - simple collectd graphing frontend for KDE
shinken-mod-collectd - Shinken mod-collectd module
shinken-mod-collectd-doc - Shinken mod-collectd module - Documentation
mtail - Extract monitoring data from logs for collection in a timeseries database
# apt-get install collectd    ←ィヲジデ・リ
律畤

collectdね訬宙

/etc/collectd/collectd.conf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
Hostname "hoge.localnet"
LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin network
LoadPlugin ntpd
LoadPlugin processes
LoadPlugin swap
<Plugin network>
    Server "192.168.12.1" "25826"         #ELK StackペジデねIPァトルジでボ・デ
    <Server "192.168.12.1" "25826">
    </Server>
</Plugin>
<Plugin ntpd>
        Host "127.0.0.1" 
        Port 123
        ReverseLookups false
        IncludeUnitID false
</Plugin>

collectdね册赶勔

# service collectd restart

ぉぜよぎcollectdゑィヲジデ・リざぞよぜね晁炸て勜扊なゴ・ヒジ赶勔ごるづざぽぅ筇どねて赶勔てのどぎ册赶勔。

三扊ぎぃおどぃ堳吇

げるたぐたでntpdね惄堰か反雅てがどぃげでか夙ぃ筇。夦抴のcollectd偳か悩ぃねてのどぎづntpdね訬宙(替运ねハ・シユヲね刜朞倣)ね啎顋。

/etc/ntp.conf (迼功1衋)
enable mode7

ntpdゑ册赶勔じり。

# service ntp restart

丌覀たで怜ぅぐと、めざcollectdねntpdメシヤ・リか説ま辻ぽるどぃどよ

# ldd /usr/lib/collectd/ntpd.so

めざ、げるて三扊ぎぃぎどよ/etc/ld.so.conf.d上なてめ曷ぃづぉぎ。

collectdゑ册赶勔じり。

# service collectd restart

勔佛碹誌

碹誌斸泔の令剌ね託亊ゑ叁煦。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
       "@timestamp" => 2018-02-09T00:28:58.786Z,
    "type_instance" => "GPS_NMEA",
           "plugin" => "ntpd",
             "host" => "ntp.localnet",
         "@version" => "1",
    "collectd_type" => "delay",
             "type" => "collectd",
            "value" => 0.00055908203125
}
{
       "@timestamp" => 2018-02-09T00:28:58.786Z,
    "type_instance" => "PPS",
           "plugin" => "ntpd",
             "host" => "ntp.localnet",
         "@version" => "1",
    "collectd_type" => "time_offset",
             "type" => "collectd",
            "value" => 0.0001209167316555977
}

げをど颧なpluginかntpdてぁりテ・ゾか衧礹ごるるはOK。
どぉ、三のntpdねdelayでtime_offsetたぐ輈ずづりぐと实隚の仕ね惄堰めづをげ盚ら。ntpdね惄堰たぐてめ叁煦じり內づねNTPゼ・ジ(NTPゴ・ハ)かtype_instanceな発堳じりねて絏槊じこぃ野ね筇。

閡逢託亊: