nagios install

新しく入れ直すのでメモ

yum search nagios
plugins がいろいろ。

nagios-plugins.x86_64 : Host/service/network monitoring program plugins for
                     : Nagios
nagios-plugins-all.x86_64 : Nagios Plugins – All plugins
nagios-plugins-apt.x86_64 : Nagios Plugin – check_apt
nagios-plugins-bdii.x86_64 : Nagios Plugin – check_bdii_entries
nagios-plugins-breeze.x86_64 : Nagios Plugin – check_breeze
nagios-plugins-by_ssh.x86_64 : Nagios Plugin – check_by_ssh
nagios-plugins-check-updates.x86_64 : A Nagios plugin to check if Red Hat or
                                   : Fedora system is up-to-date
nagios-plugins-check_sip.x86_64 : A Nagios plugin to check SIP servers and
                               : devices
nagios-plugins-cluster.x86_64 : Nagios Plugin – check_cluster
nagios-plugins-dhcp.x86_64 : Nagios Plugin – check_dhcp
nagios-plugins-dig.x86_64 : Nagios Plugin – check_dig
nagios-plugins-disk.x86_64 : Nagios Plugin – check_disk
nagios-plugins-disk_smb.x86_64 : Nagios Plugin – check_disk_smb
nagios-plugins-dns.x86_64 : Nagios Plugin – check_dns
nagios-plugins-dpm-disk.x86_64 : Nagios probes to be run in the DPM disk nodes
nagios-plugins-dpm-head.x86_64 : Nagios probes to be run in the DPM head node
nagios-plugins-dummy.x86_64 : Nagios Plugin – check_dummy
nagios-plugins-file_age.x86_64 : Nagios Plugin – check_file_age
nagios-plugins-flexlm.x86_64 : Nagios Plugin – check_flexlm
nagios-plugins-fping.x86_64 : Nagios Plugin – check_fping
nagios-plugins-game.x86_64 : Nagios Plugin – check_game
nagios-plugins-hpjd.x86_64 : Nagios Plugin – check_hpjd
nagios-plugins-http.x86_64 : Nagios Plugin – check_http
nagios-plugins-icmp.x86_64 : Nagios Plugin – check_icmp
nagios-plugins-ide_smart.x86_64 : Nagios Plugin – check_ide_smart
nagios-plugins-ifoperstatus.x86_64 : Nagios Plugin – check_ifoperstatus
nagios-plugins-ifstatus.x86_64 : Nagios Plugin – check_ifstatus
nagios-plugins-ircd.x86_64 : Nagios Plugin – check_ircd
nagios-plugins-lcgdm.x86_64 : Nagios probes to be run remotely against DPM / LFC
                           : nodes
nagios-plugins-lcgdm-common.x86_64 : Common libraries and files to all LCGDM
                                  : nagios packages
nagios-plugins-ldap.x86_64 : Nagios Plugin – check_ldap
nagios-plugins-lfc.x86_64 : Nagios probes to be run in the LFC node
nagios-plugins-linux_raid.x86_64 : Nagios Plugin – check_linux_raid
nagios-plugins-load.x86_64 : Nagios Plugin – check_load
nagios-plugins-log.x86_64 : Nagios Plugin – check_log
nagios-plugins-mailq.x86_64 : Nagios Plugin – check_mailq
nagios-plugins-mrtg.x86_64 : Nagios Plugin – check_mrtg
nagios-plugins-mrtgtraf.x86_64 : Nagios Plugin – check_mrtgtraf
nagios-plugins-mysql.x86_64 : Nagios Plugin – check_mysql
nagios-plugins-nagios.x86_64 : Nagios Plugin – check_nagios
nagios-plugins-nrpe.x86_64 : Provides nrpe plugin for Nagios
nagios-plugins-nt.x86_64 : Nagios Plugin – check_nt
nagios-plugins-ntp.x86_64 : Nagios Plugin – check_ntp
nagios-plugins-ntp-perl.x86_64 : Nagios Plugin – check_ntp.pl
nagios-plugins-nwstat.x86_64 : Nagios Plugin – check_nwstat
nagios-plugins-openmanage.x86_64 : Nagios plugin to monitor hardware health on
                                : Dell servers
nagios-plugins-oracle.x86_64 : Nagios Plugin – check_oracle
nagios-plugins-overcr.x86_64 : Nagios Plugin – check_overcr
nagios-plugins-perl.x86_64 : Nagios plugins perl dep.
nagios-plugins-pgsql.x86_64 : Nagios Plugin – check_pgsql
nagios-plugins-ping.x86_64 : Nagios Plugin – check_ping
nagios-plugins-procs.x86_64 : Nagios Plugin – check_procs
nagios-plugins-radius.x86_64 : Nagios Plugin – check_radius
nagios-plugins-real.x86_64 : Nagios Plugin – check_real
nagios-plugins-rhev.noarch : Nagios Plugin – check_rhev
nagios-plugins-rpc.x86_64 : Nagios Plugin – check_rpc
nagios-plugins-sensors.x86_64 : Nagios Plugin – check_sensors
nagios-plugins-smtp.x86_64 : Nagios Plugin – check_smtp
nagios-plugins-snmp.x86_64 : Nagios Plugin – check_snmp
nagios-plugins-ssh.x86_64 : Nagios Plugin – check_ssh
nagios-plugins-swap.x86_64 : Nagios Plugin – check_swap
nagios-plugins-tcp.x86_64 : Nagios Plugin – check_tcp
nagios-plugins-time.x86_64 : Nagios Plugin – check_time
nagios-plugins-ups.x86_64 : Nagios Plugin – check_ups
nagios-plugins-users.x86_64 : Nagios Plugin – check_users
nagios-plugins-wave.x86_64 : Nagios Plugin – check_wave

nagios-plugins-all で全部入れても良いけど、とりあえず使うのだけ入れます。

 sudo yum install nagios \
 nagios-common \
 nagios-plugins \
 nagios-plugins-by_ssh \
 nagios-plugins-dig \
 nagios-plugins-disk \
 nagios-plugins-http \
 nagios-plugins-icmp \
 nagios-plugins-load \
 nagios-plugins-log \
 nagios-plugins-procs \
 nagios-plugins-ping \
 nagios-plugins-ssh \
 nagios-plugins-swap \
 nagios-plugins-tcp \
 nagios-plugins-time \
 nagios-plugins-users

とりあえずこんな感じで。1Mちょっとインストール。

設定ファイル
/etc/nagios/nagios.cfg
デフォルトメールを設定する
admin_email=nagios@localhost
admin_pager=pagenagios@localhost

pagerってポケベル(ポケットベル)って意味だそうです。へぇ〜ですね

# cfg_dirでディレクトリ毎設定読込み
# cfg_dir=/etc/nagios/front_servers
# cfg_dir=/etc/nagios/proxy_servers

cfg_file=/etc/nagios/conf.d/front_servers.cfg
とりあえず front_servers.cfgにapacheのチェックを入れる。

中身はconf.d/internet.cfgと同じ。
httpのチェックを、ドメインだけで無くip+portでも

http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html

http://nagios.sourceforge.net/docs/3_0/macros.html

http://nagiosplugins.org/man/check_http

check_httpとmacroを組み合わせて

define host{
       use             template-internet-host
       host_name       groundroad_internal
       address         192.168.0.170
       _HTTPPORT       8080
       _HTTPURI        /company
       _HTTPSTRING     company profile
       notes           groundroad local check
       notes_url       http://groundroad.com
       }

define hostgroup{
       hostgroup_name  LocalHttpHosts
       alias           Local Http Hosts
       members         groundroad_internal
       }

define service{
       use             generic-service
       hostgroup_name          LocalHttpHosts
       service_description     local http check string
       check_command   check_http!-p $_HOSTHTTPPORT$ -u $_HOSTHTTPURI$ -t 3 -s “$_HOSTHTTPSTRING$”

}

cgi.cfg
nagiosadmin以外のユーザーに変えたのでcgi.cfgのnadiosadminを変えました。

/etc/nagios/objects/contacts.cfg
こちらもemailを変更

apache勝手に出来てるので、必要に応じて変更
/etc/httpd/conf.d/nagios.conf
適当なportとヴァーチャルホストを設定してみま

Listen 17202

DocumentRoot /var/www/vacant/html
ServerName nagios.monitoring

以下デフォルト、cgi-bin, nagiosのaliasと認証

apache再起動
ローカルDNSにドメインを設定

http://nagios.monitoring:17202/nagios/

認証すると Nagios Coreのトップページが表示されました。

設定を確認
# sudo nagios -v /etc/nagios/nagios.cfg
/etc/nagios/conf.d

警告、エラーが無ければ起動
# sudo /etc/init.d/nagios start

とりえあず設定&リクエストは成功しました。
HTTP CRITICAL: HTTP/1.1 403 Forbidden – string ‘company profile’ not found on ‘http://192.168.0.170:8080/company’ – 458 bytes in 0.002 second response time

This entry was posted on 土曜日, 11月 24th, 2012 at 6:18 PM and is filed under 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アプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。