Nagios-nrpe

提供:Dev Guides
移動先:案内検索

ナギオス-NRPE

NRPE(Nagios Remote Plugin Executor)のリモートマシンでチェックを実行するNagiosデーモン。 他のマシンでNagiosプラグインをリモートで実行できます。 ディスク使用量、CPU負荷などのリモートマシンメトリックを監視できます。 また、一部のWindowsエージェントアドオンを介して、リモートWindowsマシンのメトリックを確認できます。

プラグインエグゼキューター

監視する必要があるクライアントマシンにNRPEをステップごとにインストールして構成する方法を見てみましょう。

  • ステップ1 *-以下のコマンドを実行して、監視対象のリモートLinuxマシンにNRPEをインストールします。
sudo apt-get install nagios-nrpe-server nagios-plugins
  • ステップ2 *-次に、サーバーディレクトリ内にホストファイルを作成し、ホストに必要なすべての定義を配置します。
sudo gedit/usr/local/nagios/etc/servers/ubuntu_host.cfg
# Ubuntu Host configuration file

define host {
   use linux-server
   host_name ubuntu_host
   alias Ubuntu Host
   address 192.168.1.10
   register 1
}

define service {
   host_name ubuntu_host
   service_description PING
   check_command check_ping!100.0,20%!500.0,60%
   max_check_attempts 2
   check_interval 2
   retry_interval 2
   check_period 24x7
   check_freshness 1
   contact_groups admins
   notification_interval 2
   notification_period 24x7
   notifications_enabled 1
   register 1
}

define service {
   host_name ubuntu_host
   service_description Check Users
   check_command check_local_users!20!50
   max_check_attempts 2
   check_interval 2
   retry_interval 2
   check_period 24x7
   check_freshness 1
   contact_groups admins
   notification_interval 2
   notification_period 24x7
   notifications_enabled 1
   register 1
}

define service {
   host_name ubuntu_host
   service_description Local Disk
   check_command check_local_disk!20%!10%!/
   max_check_attempts 2
   check_interval 2
   retry_interval 2
   check_period 24x7
   check_freshness 1
   groups admins
   notification_interval 2
   notification_period 24x7
   notifications_enabled 1
   register 1
}

define service {
   host_name ubuntu_host
   service_description Check SSH
   check_command check_ssh
   max_check_attempts 2
   check_interval 2
   retry_interval 2
   check_period 24x7
   check_freshness 1
   contact_groups admins
   notification_interval 2
   notification_period 24x7
   notifications_enabled 1
   register 1
}

define service {
   host_name ubuntu_host
   service_description Total Process
   check_command check_local_procs!250!400!RSZDT
   max_check_attempts 2
   check_interval 2
   retry_interval 2
   check_period 24x7
   check_freshness 1
   contact_groups admins
   notification_interval 2
   notification_period 24x7
   notifications_enabled 1
   register 1
}
  • ステップ3 *-設定ファイルの検証のために以下に示すコマンドを実行します。
sudo/usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg

構成の検証

  • ステップ4 *-エラーがなければ、NRPE、Apache、Nagiosを再起動します。
service nagios-nrpe-server restart
service apache2 restart
service nagios restart
  • ステップ5 *-ブラウザを開き、Nagios Webインターフェイスに移動します。 監視する必要のあるホストがNagiosコアサービスに追加されていることがわかります。 同様に、Nagiosによって監視されるホストをさらに追加できます。

Nagios Webインターフェイス