Nagios クライアントインストール

Nagios クライアントインストール


インストール


[root@L1 bozu]# yum install nagios-nrpe
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: rsync.atworks.co.jp
* base: rsync.atworks.co.jp
* epel: ftp.iij.ad.jp
* extras: rsync.atworks.co.jp
* updates: rsync.atworks.co.jp
Setting up Install Process
Resolving Dependencies

    • > Running transaction check
      • > Package nrpe.i386 0:2.12-16.el5 set to be updated
    • > Finished Dependency Resolution

Dependencies Resolved

============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
nrpe i386 2.12-16.el5 epel 220 k

Transaction Summary
============================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 220 k
Is this ok [y/N]: y
Downloading Packages:
nrpe-2.12-16.el5.i386.rpm | 220 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nrpe 1/1

Installed:
nrpe.i386 0:2.12-16.el5

Complete!
[root@L1 bozu]#


[root@L1 bozu]# yum install nagios-plugins-nrpe
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: rsync.atworks.co.jp
* base: rsync.atworks.co.jp
* epel: ftp.iij.ad.jp
* extras: rsync.atworks.co.jp
* updates: rsync.atworks.co.jp
Setting up Install Process
Resolving Dependencies

    • > Running transaction check
      • > Package nagios-plugins-nrpe.i386 0:2.12-16.el5 set to be updated
    • > Processing Dependency: nagios-plugins for package: nagios-plugins-nrpe
    • > Running transaction check
      • > Package nagios-plugins.i386 0:1.4.15-2.el5 set to be updated
    • > Processing Dependency: nagios-common for package: nagios-plugins
    • > Running transaction check
      • > Package nagios-common.i386 0:2.12-10.el5 set to be updated
    • > Finished Dependency Resolution

Dependencies Resolved

============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
nagios-plugins-nrpe i386 2.12-16.el5 epel 21 k
Installing for dependencies:
nagios-common i386 2.12-10.el5 epel 9.3 k
nagios-plugins i386 1.4.15-2.el5 epel 224 k

Transaction Summary
============================================================================================
Install 3 Package(s)
Upgrade 0 Package(s)

Total download size: 254 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): nagios-common-2.12-10.el5.i386.rpm | 9.3 kB 00:00
(2/3): nagios-plugins-nrpe-2.12-16.el5.i386.rpm | 21 kB 00:00
(3/3): nagios-plugins-1.4.15-2.el5.i386.rpm | 224 kB 00:00

                                                                                                                                                                                      • -

Total 650 kB/s | 254 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nagios-common 1/3
Installing : nagios-plugins 2/3
Installing : nagios-plugins-nrpe 3/3

Installed:
nagios-plugins-nrpe.i386 0:2.12-16.el5

Dependency Installed:
nagios-common.i386 0:2.12-10.el5 nagios-plugins.i386 0:1.4.15-2.el5

Complete!
[root@L1 bozu]#

監視サーバからアクセスが出来るようにします。


[root@L1 bozu]# vi /etc/nagios/nrpe.cfg

77 # NOTE: This option is ignored if NRPE is running under either inetd or xinetd
78
79 ##allowed_hosts=127.0.0.1
80 allowed_hosts=10.83.62.202
81

起動


[root@L1 bozu]# /sbin/service nrpe start
Starting nrpe: [ OK ]
[root@L1 bozu]# /sbin/chkconfig nrpe on

監視設定


[root@L1 bozu]# vi /etc/nagios/nrpe.cfg

197 # The following examples use hardcoded command arguments...
198
199 command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
200 command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
201 command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
202 command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
203 command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
204

/dev/hda1など結構細かい指定が必要です。


監視サーバ側の設定です。


[root@L2 nagios]# vi /etc/nagios/servers/L1.cfg

define host{
use L-servers
host_name L1
alias L1
address 10.83.62.201
}
define service{
use local-service
host_name L1
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

# nrpe - check crond
define service{
use local-service
normal_check_interval 10
notification_interval 30
host_name L1
service_description nrpe - procs
check_command check_nrpe!check_total_procs
}

# nrpe - check sshd
define service{
use local-service
normal_check_interval 10
notification_interval 30
host_name L1
service_description nrpe - load
check_command check_nrpe!check_load
}

define service{
use local-service
normal_check_interval 10
notification_interval 30
host_name L1
service_description nrpe - disk
check_command check_nrpe!check_hda2
}