延續[Day20 - Splunk] Nagios and Splunk integration - 3/4,本文分享透過「Splunk for Nagios」App查看Nagios主機監控資訊
[Lab Information]
主機硬體規格及相關資訊如下:
OS: Rat Hat Enterprise Linux 6.2 64 bit
Linux Kernel: 2.6.32
CPU Type: Intel Xeon CPU E5-2620 2.00GHz
CPU Core: 8
Memory: 16GB
Splunk version: 5.0.4
OS root password: 12345678
Splunk Web IP: 192.168.0.101
Splunk Web admin password: changeme
Splunk Forwarder IP: 192.168.0.102
[Use Splunk for Nagios]
當Splunk Forwarder及Splunk Indexer設定完成後,即可透過Splunk Web查看相關資訊,步驟如下:
[Configure Livestatus on Splunk Web]
若要執行「Livestatus Dashboards」功能,請確認mk-livestatus套件已事先安裝,若未安裝此套件可先參閱[Day19 - Splunk] Nagios and Splunk integration - 2/4進行安裝
安裝完畢後,需於Splunk Web進行下列設定:
使用帳號:root登入Splunk Web,並切換至使用者:splunk
su - splunk
編輯檔案:/opt/splunk/etc/apps/SplunkForNagios/bin/mklivestatus.py,將參數:Host異動為Splunk Forwarder IP,如下步驟:
vim /opt/splunk/etc/apps/SplunkForNagios/bin/mklivestatus.py
'# 以下皆為使用者:splunk進行操作 #'
HOST = [ '192.168.0.102' ]
PORT = 6557
使用下列步驟確認Splunk Web與Splunk Forwarder之間可正常連線:
/opt/splunk/etc/apps/SplunkForNagios/bin/test-mklivestatus.py
[Use Livestatus Dashboards Function]
透過「Livestatus Dashboards」功能可直接觀看Nagios Server的主機監控狀態,如下步驟:
[Reference]
Splunk for Nagios
Nagios integration