咨询电话 4006505646
中央电视台-RAID数据恢复成功 中国网通-IBM EXP300磁盘阵列数据恢复成功 工商银行某省分行-AIX删除LV数据恢复成功
中国石油管理局-Oracle数据库恢复成功 中国联通信息平台HP-UX,ORACLE数据库误RM 中国地质环境监测院-HP LH3000服务器数据恢复成功
您当前的位置:首页>>技术文章>>Solaris>>正文

Solaris下的nagios监控系统

来源:51cto.com

Solaris下的nagios监控系统介绍如下:

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

  1. # groupadd nagios  
  2.  
  3. # useradd -g nagios -d /usr/local/nagios nagios  
  4.  
  5. # gunzip ./nagios-3.0.6.tar.gz  
  6.  
  7. # tar xvf ./nagios-3.0.6.tar.gz  
  8.  
  9. # cd ./nagios-3.0.6.tar.gz  
  10.  
  11. # ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios \  
  12.  

--with-nagios-group=nagios --with-gd-lib=/usr/sfw/lib \

--with-gd-inc=/usr/sfw/include

  1. # make all  
  2.  
  3. # make fullinstall  
  4.  
  5. # make install-config  
  6.  

2.安装openssl

  1. # gunzip ./openssl-0.9.8j-sol10-sparc-local.gz  
  2.  
  3. # pkgadd -d ./openssl-0.9.8j-sol10-sparc-local  
  4.  
  5. # export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH  
  6.  

3.安装Nagios Plugins

  1. # gunzip ./nagios-plugins-1.4.13.tar.gz  
  2.  
  3. # tar xvf ./nagios-plugins-1.4.13.tar  
  4.  
  5. # cd nagios-plugins-1.4.13  
  6.  
  7. # ./configure --without-mysql --prefix=/usr/local/nagios --with-openssl=/usr/local/ssl  
  8.  
  9. # make  
  10.  
  11. # make install  
  12.  
  13. # make clean  
  14.  
  15. # chown -R nagios:nagios /usr/local/nagios/libexec  
  16.  

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

6.启动Nagios

Nagios的启动程序是/usr/local/nagios/bin/nagios

# ./nagios --help

Nagios 3.0.3

Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)

Last Modified: 06-25-2008

License: GPL

Usage: ./nagios [options]

Options:

-v, --verify-config Verify all configuration data

-s, --test-scheduling Shows projected/recommended check scheduling and other

diagnostic info based on the current configuration files.

-x, --dont-verify-paths Don't check for circular object paths - USE WITH CAUTION!

-p, --precache-objects Precache object configuration - use with -v or -s options

-u, --use-precached-objects Use precached object config file

-d, --daemon Starts Nagios in daemon mode, instead of as a foreground process

Visit the Nagios website at http://www.nagios.org/ for bug fixes, new

releases, online documentation, FAQs, information on subscribing to

the mailing lists, and commercial support options for Nagios.

首先通过-v选项验证配置文件是否正确

# cd /usr/lcoal/nagios/bin

# ./nagios -v ../etc/nagios.cfg

Nagios 3.0.3

Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)

Last Modified: 06-25-2008

License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...

.........................................................

.............................................

Total Warnings: 0

Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

如果没有错误,就可以启动它了。

# cd /usr/local/nagios/bin

# ./nagios -d /usr/local/nagios/etc/nagios.cfg

nagios web界面提示

It appears as though you do not have permission to view information for any of the services you requested...

打开cgi.cfg配置文件,里面有个参数:

use_authentication=1

为了保障系统的安全性,nagios设置了这个参数,默认为1,改为0即可

查看/usr/local/nagios/var/nagios.log日志文件,观察启动是否正常。

在IE浏览器中查看监控情况。

点击左边导航栏的 Host Detail

通过文章的介绍,我们清楚的知道了Solaris下的nagios监控系统的全过程,希望大家喜欢!

 

RAID损坏后对数据的完整备份
[详细请进...]
中国联通信息平台HP-UX,ORAC
中国石油管理局-Oracle数据库
国家质量监督总局-ORACLE数据
成功解决SAN 的7TB大容量数据
EVA3000 HP-UX服务器数据恢复
中国地质环境监测院- LH3000
卫生部-X226 IBM服务器数据恢
互联网协会- DELL服务器数据
北京市昌平区医院-2800 DEL
IBM X3650服务器,RAID5,有两
上门恢复
服务承诺
异地恢复
收费标准
付款方式
疑难解答

版权所有 北京北亚宸星科技有限公司
全国统一客服电话:4006-505-646
地址:北京市海淀区永丰基地丰慧中路7号新材料创业大厦B座205室
京ICP备09039053

l://p://