腾讯视频/爱奇艺/优酷/外卖 充值4折起
solaris下的nagios监控系统
文将介绍nagios在solaris10操做系统下的安装过程,其中包括,源码的编译、安装;apache的安装、nagios cgi的配置;nagios监控配置等。
solaris下的nagios监控系统介绍如下:
图-nagios
文将介绍nagios在solaris10操做系统下的安装过程,其中包括,源码的编译、安装;apache的安装、nagios cgi的配置;nagios监控配置等。
环境、资源准备
gcc-3.4.6-sol10-x86-local.gz
libiconv-1.11-sol10-x86-local.gz
libintl-3.4.0-sol10-x86-local.gz
make-3.81-sol10-x86-local.gz
openssl-0.9.8h-sol10-x86-local.gz
gd-2.0.35-sol10-x86-local.gz
httpd-2.2.4.tar.gz
nagios-3.0.3.tar.gz
nagios-plugins-1.4.11.tar.gz
nrpe-2.12.tar.gz
1.安装nagios
# groupadd nagios # useradd -g nagios -d /usr/local/nagios nagios # gunzip ./nagios-3.0.6.tar.gz # tar xvf ./nagios-3.0.6.tar.gz # cd ./nagios-3.0.6.tar.gz # ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios
--with-nagios-group=nagios --with-gd-lib=/usr/sfw/lib
--with-gd-inc=/usr/sfw/include
# make all # make fullinstall # make install-config
2.安装openssl
# gunzip ./openssl-0.9.8j-sol10-sparc-local.gz # pkgadd -d ./openssl-0.9.8j-sol10-sparc-local # export ld_library_path=/usr/local/ssl/lib:$ld_library_path
3.安装nagios plugins
# gunzip ./nagios-plugins-1.4.13.tar.gz # tar xvf ./nagios-plugins-1.4.13.tar # cd nagios-plugins-1.4.13 # ./configure --without-mysql --prefix=/usr/local/nagios --with-openssl=/usr/local/ssl # make # make install # make clean # chown -r nagios:nagios /usr/local/nagios/libexec
4.配置apache
在/etc/apache2/httpd.conf文件追加如下内容
#setting for nagios
scriptalias /nagios/cgi-bin /usr/local/nagios/sbin
authtype basic
options execcgi
allowoverride none
order allow,deny
allow from all
authname "nagios access"
authuserfile /usr/local/nagios/etc/htpasswd
require valid-user
alias /nagios /usr/local/nagios/share
authtype basic
options none
allowoverride none
order allow,deny
allow from all
authname "nagios access"
authuserfile /usr/local/nagios/etc/htpasswd
require valid-user
5.生成登录用户和验证口令
# /usr/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd
此处的user_name为登录nagios web应用需要输入的用户名www.britepic.org
按照提示输入要设置的口令即可
配置/usr/local/nagios/etc/cgi.cfg,添加用户edison
................. .................
# system/process information access
# this option is a comma-delimited list of all usernames that
# have access to viewing the nagios process information as
# provided by the extended information cgi (extinfo.cgi). by
# default, *no one* has access to this unless you choose to
# not use authorization. you may use an asterisk (*) to
# authorize any user who has authenticated to the web server.
authorized_for_system_information=nagiosadmin,edison
# configuration information access
# this option is a comma-delimited list of all usernames that
# can view all configuration information (hosts, commands, etc).
# by default, users can only view configuration information
# for the hosts and services they are contacts for. you may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.
authorized_for_configuration_information=nagiosadmin,edison
# system/process command access
# this option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to nagios via the
# command cgi (cmd.cgi). users in this list can also change
# the program mode to active or standby. by default, *no one*
# has access to this unless you choose to not use authorization.
# you may use an asterisk (*) to authorize any user who has
# authenticated to the web server.
authorized_for_system_commands=nagiosadmin,edison
# global host/service view access
# these two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. by default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). you may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=nagiosadmin,edison
authorized_for_all_hosts=nagiosadmin,edison
# global host/service command access
# these two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# cgi (cmd.cgi) for all hosts and services that are being monitored.
# by default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). you may use an asterisk (*) to authorize any
# user who has authenticated to the web server.
authorized_for_all_service_commands=nagiosadmin,edison
authorized_for_all_host_commands=nagiosadmin,edison