Shinken のインストール、設定方法

1.Server側のインストール
①#apt-get install shinken
②root@ubuntu14:~# dpkg -l | grep shinken
rc shinken 1.4-2 amd64 Flexible monitoring tool – Meta-package
ii shinken-common 1.4-2 amd64 Flexible monitoring tool – Common files
ii shinken-module-broker-webui 1.4-2 amd64 Shinken WebUI broker module
ii shinken-module-broker-webui-cfgpassword 1.4-2 amd64 Shinken cfg_password authentifcation module for WebUI broker
ii shinken-module-broker-webui-sqlitedb 1.4-2 amd64 Shinken Sqlite storage module for WebUI broker

③vi /etc/default/shinken 34行目の内容変更下記
BIN=/usr/lib/python2.7/dist-packages/shinken/bin

④server shinken start
⑤ vi /etc/shinken/hosts/nfs.cfg
define host{
use linux
address XXX.XXX.XXX.XXX
host_name nfs
}
define service{
use ssh ; Name of service template to use

host_name nfs
service_description SSH check
retry_interval 1
check_interval 5
max_check_attempts 2
check_command check_ssh
notifications_enabled 0
}
2.client側のインストール
① #apt-get install shinken
② vim /etc/default/shinken 34行目の内容変更下記
BIN=/usr/lib/python2.7/dist-packages/shinken/bin
③ 39行目の内容変更下記
AVAIL_MODULES="poller"
④ root@ubuntu14:/etc/shinken/hosts# service shinken start
Starting poller:
…done.

3.Server側の設定
① vi /etc/shinken/hosts/test.cfg

define host{
use linux
host_name test
address XXX.XXX.XXX.XXX #clientのIP
}

define service{

use local-service ; Name of service template to use
host_name test
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

define service{
use local-service ; Name of service template to use
host_name test
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
define service{
use local-service ; Name of service template to use
host_name test
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}

②新しいpollerを追加
vi /etc/shinken/shinken-specific/poller.cfg

define poller {
poller_name poller-test #poller名前
address 10.239.21.49 #client側のIP
port 7771 #ディフォルトのポート7771

## Optional
manage_sub_realms 0 ; Does it take jobs from schedulers of sub-Realms?
min_workers 0 ; Starts with N processes (0 = 1 per CPU)
max_workers 0 ; No more than N processes (0 = 1 per CPU)
processes_by_worker 256 ; Each worker manages N checks
polling_interval 1 ; Get jobs from schedulers each N minutes
timeout 3 ; Ping timeout
data_timeout 120 ; Data send timeout
max_check_attempts 3 ; If ping fails N or more, then the node is dead
check_interval 60 ; Ping node every N seconds

## Interesting modules that can be used:
# – NrpeBooster = Replaces the check_nrpe binary. Therefore it
# enhances performances when there are lot of NRPE
# calls.
# – CommandFile = Allow the poller to read a nagios.cmd named pipe.
# This permits the use of distributed check_mk checks
# should you desire it.
# – SnmpBooster = Snmp bulk polling module
#modules NrpeBooster, CommandFile
modules

## Advanced Features
#passive 0 ; For DMZ monitoring, set to 1 so the connections
; will be from scheduler -> poller.
#poller_tags None
realm All
}
③ server側のshinkenが再起動

Source

Posted by arkgame