免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1693 | 回复: 0
打印 上一主题 下一主题

install nagios, a system and network monitoring application [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-08-10 04:46 |只看该作者 |倒序浏览
install nagios on Fedora Core 1, a system and network monitoring application

1. Go to http://www.nagios.org   or
    http://dag.wieers.com/packages/nagios/
   download rpm file
    read the doc at http://nagios.sourceforge.net/docs/1_0/toc.html

2. Install it by
   rpm -ivh nagios-1.1-6.rhfc1.dag.i386.rpm

3. important files
   /usr/share/nagios
   /usr/lib/nagios/cgi
   /etc/nagios
   /usr/bin/nagios

4. Configure files (the most important part)
   edit files under /etc/nagios according to documentation.
   hosts.cfg
   services.cfg
   ...

5. Setting Up The Web Interface
   httpd.conf
- Configure Alias For The HTML Files
Alias /nagios/ /usr/share/nagios/
<Directory "/usr/share/nagios">;
    Options None
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>;

- Configure Script Alias For The CGIs
   ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi/
  <Directory "/usr/lib/nagios/cgi/">;
    AllowOverride AuthConfig
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>;

restart httpd

6. Install Nagios Plugins
Plugins are compiled executables or scripts (Perl, shell, etc.) that can be run
from a command line to check the status or a host or service.
Get from http://sourceforge.net/project/showfiles.php?group_id=29880&package_id=21883
nagios-plugins-1.3.1-1.9.i386.rpm

[root@vmredhat root]# rpm -ivh nagios-plugins-1.3.1-1.9.i386.rpm

6. Start NAgios
  /usr/bin/nagios /etc/nagios/nagios.cfg

7. From web browser:
  http://192.168.0.127/nagios/
  NOT
  http://192.168.0.127/nagios  !!!!!!!!!!

8. At this point, the Nagios Web interface should come up properly,
     but you will notice that you cannot access any of the pages.
     You will get an error message that looks like the following.

"It appears as though you do not have permission to view information for any of the hosts you requested... If you believe

this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization

options in your CGI configuration file."

This is a security precaution that is designed to only allow authorized people to be able to access the monitoring interface.

The authentication is handled by your Web server using Basic HTTP Authentication (i.e. .htaccess). Nagios then uses the

credentials for the user who has logged in and matches it with the contacts.cfg contact_name entries to determine which

sections of the Web interface the current user can access.

Configuring .htaccess based authentication is easy provided that your Web server is already configured to use it. Please

refer to the documentation for your Web server if it's not configured. We will assume that our Apache server is configured to

look at the .htaccess file and apply the directives found in it.

First, create a file called .htaccess in the /usr/lib/nagios/cgi directory. If you would like to lock up your Nagios Web

interface completely, you can also put a copy of the same file in the /usr/share/nagios/ directory.

Put the following in this .htaccess file.

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
require valid-user


When adding the first user, the password file that .htaccess refers to will not be present.
You need to run the 'htpasswd' command with the -c option to create the file.

htpasswd -c  /etc/nagios/htpasswd.users waypin
New password: ******
Re-type new password: ******
Adding password for user waypin

For the rest of your users, use the 'htpasswd' command without the '-c' option so as not to overwrite the existing one. After

you add all of your users, you can go back to the Web interface which will now pop up an authentication dialog. Upon

successful authentication, you can start using the Web interface. I will not go into detail about using the Web interface

since it's pretty self explanatory. Notice that your users will only be able to access information for servers that they are

associated with in the Nagios configuration files. Also, some sections of the Web interface will be disabled for everyone by

default. If you would like to enable those, take a look at '/etc/nagios/cgi.cfg'.
For instance, in order to allow the user 'oktay' to access the 'Process Info' section, uncomment the

'authorized_for_system_information' line and add 'waypin'
to the list of names delimited by commas.

#part of cgi.cfg

# 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=waypin



# 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=waypin




Reference:
1. http://www.onlamp.com/lpt/a/2705

2. http://nagios.sourceforge.net/docs/1_0/
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP