纳吉欧斯 是一个 开源软件 用于 网络和基础设施监控. 纳吉欧斯 将要 监控服务器、交换机、应用程序和服务. 它提醒 系统管理员 当出现问题时,也会在问题得到纠正时发出警报。
另请查看: 如何为 RHEL/CentOS 6/5 启用 EPEL 存储库
yum install nagios nagios-devel nagios-plugins* gd gd-devel httpd php gcc glibc glibc-common
Bydefualt yum install nagios,在 cgi.cfg 文件中,提到了授权用户名 nagiosadmin 并使用 htpasswd 文件 /etc/nagios/passwd 文件。所以为了简单的步骤,我使用相同的名称。
# htpasswd -c /etc/nagios/passwd nagiosadmin
检查 /etc/nagios/cgi.cfg 中的以下给定值
nano /etc/nagios/cgi.cfg
# AUTHENTICATION USAGE use_authentication=1 # SYSTEM/PROCESS INFORMATION ACCESS authorized_for_system_information=nagiosadmin # CONFIGURATION INFORMATION ACCESS authorized_for_configuration_information=nagiosadmin # SYSTEM/PROCESS COMMAND ACCESS authorized_for_system_commands=nagiosadmin # GLOBAL HOST/SERVICE VIEW ACCESS authorized_for_all_services=nagiosadmin authorized_for_all_hosts=nagiosadmin # GLOBAL HOST/SERVICE COMMAND ACCESS authorized_for_all_service_commands=nagiosadmin authorized_for_all_host_commands=nagiosadmin
为了提供对 http 中 nagiosadmin 用户的访问权限,存在 /etc/httpd/conf.d/nagios.conf 文件。 下面是 nagios 服务器的 nagios.conf 配置。
cat /etc/http/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER # Last Modified: 11-26-2005 # # This file contains examples of entries that need # to be incorporated into your Apache web server # configuration file. Customize the paths, etc. as # needed to fit your system.
ScriptAlias /nagios/cgi-bin/ “/usr/lib/nagios/cgi-bin/”
# SSLRequireSSL Options ExecCGI AllowOverride None Order allow,deny Allow from all # Order deny,allow # Deny from all # Allow from 127.0.0.1 AuthName “Nagios Access” AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user
别名 /nagios “/usr/share/nagios/html”
# SSLRequireSSL Options None AllowOverride None Order allow,deny Allow from all # Order deny,allow # Deny from all Allow from 127.0.0.1 AuthName “Nagios Access” AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user
启动httpd和nagios /etc/init.d/httpd start /etc/init.d/nagios start [warn]笔记: SELINUX 和 IPTABLE 被禁用。[/warn] 访问 nagios 服务器 通过 https://nagios_server_ip-address/nagios 提供用户名 = nagiosadmin 和您提供给 nagiosadmin 用户的密码。
另请查看: 将客户端添加到 Nagios 服务器