目次

ubunt18.04にnagios

apt-get install nagios3

password設定

cd /etc/nagios3
##パスワードを再設定
sudo htpasswd ./htpasswd.users nagiosadmin
##パスワード入力

監視ホスト追加

設定

/etc/nagios3/nagios.cfg

nagiosのメイン設定ファイル。各cfgファイルのパスを設定

/etc/nagios3/conf.d

nagios.cfgで標準設定されている各host設定ファイルの場所

サーバ毎にファイル作成

localhost_nagis2.cfgを元にhost_xxxx.cfgを作成する

参考

http://www.k-staging.com/?p=1252

設定の読み込み

nagiosはapacheの再起動でなくnagiosサービスを再起動する

sudo service nagios3 stop
sudo service nagios3 start

ubunt12.04にnagios

apt-get install nagios3

postfix install → internet site

https://www.digitalocean.com/community/tutorials/how-to-install-nagios-on-ubuntu-12-10

* 日本語ドキュメント http://nagios.x-trans.jp/nagios/index.php/Nagios_3%E7%BF%BB%E8%A8%B3%E3%83%89%E3%82%AD%E3%83%A5%E3%83%A1%E3%83%B3%E3%83%88

設定方法

/etc/nagios3/conf.d/generic-host_nagios2.cfg

をコピーして設定ファイルを作成し

define host{
      use                             check-host
      host_name                       host.xxxxx.jp
      alias                           dns
      address                         xxx.xxx.xxx.xxx(or fqdn)
      }  

/etc/nagios3/host.cfgを作成 とりあえずhost設定だけで死活監視ができた。

check-hostの内容は・・

/etc/nagios-plugins/config/ping.cfg

を編集