nagios nrpe settings

pdf

http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf

yumで入れるだけなので
サーバー側追加 plugin
nagios-plugins-nrpe.x86_64 : Provides nrpe plugin for Nagios
クライアント側( nagios と必要な pluginsも入れます。
nrpe.x86_64 : Host/service/network monitoring agent for Nagios

クライアント側設定
/etc/nagios/nrpe.cfg

server_port=25666
# 待ち受け interface
server_address=192.168.0.26
# サーバー ipaddress
allowed_hosts=192.168.0.170

( iptablesでこれを許可します。

起動

$ sudo /etc/init.d/nrpe start
Starting nrpe:                                             [  OK  ]

確認

$ netstat -na|grep 25666
tcp        0      0 192.168.0.26:25666         0.0.0.0:*                   LISTEN      
$ /usr/lib64/nagios/plugins/check_nrpe -H 192.168.0.26 -p 25666
NRPE v2.13

* allow_hostsに入っていないサーバーから行うとerror
CHECK_NRPE: Error – Could not complete SSL handshake.

clientの設定はこれだけ

後はサーバーに監視設定を追加するだけ
■ サーバー側設定

“objects/commands.cfg”にコマンド追加

# ‘check_nrpe’ command defination
define command{
       command_name    check_nrpe
       command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -p 25666 -c $ARG1$
       }

とりあえず、こんな感じでcfg追加

define host{
       use             template-internet-host
       host_name       server_26
       address         192.168.0.26
       notes           normal vps
       name  server_26
       }
define hostgroup{
       hostgroup_name  NrpeHosts
       alias           Nrpe All Hosts
       members         server_26,server_27,server_28
       }
define service{
       use                  generic-service
       hostgroup_name       NrpeHosts
       service_description  CPU Load
       check_command        check_nrpe!check_load
       }
define service{
       use                  generic-service
       hostgroup_name       NrpeHosts
       service_description  Current Users
       check_command        check_nrpe!check_users
}

# nagios -v nagios.cfg
# /etc/init.d/nagios restart

問題なくデータ取得出来ました。

* クライアント側でオプションパラメーター設定
nrpe.cfg のコマンド設定部分に
vi /usr/local/nagios/etc/nrpe.cfg
# Add a new check_swap command definition that uses the command line from above and save the file.
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
のようにオプション設定する。

This entry was posted on 日曜日, 11月 25th, 2012 at 7:56 PM and is filed under nagios, server. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。