Top/Nagios/プラグイン/check_ntp

check_ntpはてなブックマーク

NTPサーバと実行したホストとの時間のずれをチェックするプラグイン。

対象

リモート (or ローカル)

アーカイブ内での位置

plugins/check_ntp

必要なもの

実行には下記が必要

  • ntp

実行

1秒ずれていると WARNING、2秒ずれていると CRITICAL。

/usr/local/nagios/libexec/check_ntp -H 133.100.9.2 -w 1 -c 2

checkcommands.cfgでの定義

vi /usr/local/nagios/etc/checkcommands.cfg
# 'check_ntp' command definition
define command{
        command_name    check_ntp
        command_line    $USER1$/check_ntp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
        }

サービスの定義

define service{
        use                             generic-service
        host_name                       hoge
        service_description             NTP
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           240
        notification_period             24x7
        notification_options            c,r
        check_command                   check_ntp!1!2
        contact_groups                  linux-admins
        }

備考

  • NTP導入前にプラグインを導入した場合、/usr/local/nagios/libexec/utils.pmにntpdate等のパスの定義が必要
  • NRPE と組み合わせると、NTPサーバとリモートホストとのずれをチェックできる。

Amazon

差分 一覧