Linux安装nagios监控软件(二)修复问题
Linux安装nagios监控软件(二)修复问题安装好了nagios后,点击菜单上的map,发现页面有错误信息如下:
/nagios/cgi-bin/statusmap.cgi was not found on this server
参考如下BLOG:[url]http://www.245100.com/thread-12353-1-1.html[/url]
检查我本机是否安装了对应的包
rpm包的搜索地址
[url]http://www.rpmfind.net/linux/rpm2html/search.php?query=&submit=Search+...&system=&arch=[/url]
libgd包
wget [url]http://www.libgd.org/releases/gd-2.0.35.tar.gz[/url]
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure
make
make install
libpng包
wget [url]http://nchc.dl.sourceforge.net/project/libpng/00-libpng-stable/1.2.41/libpng-1.2.41.tar.gz[/url]
tar zxvf libpng-1.2.41.tar.gz
cd libpng-1.2.41/
./configure
make
make install
zlib包
wget [url]http://www.zlib.net/zlib-1.2.3.tar.gz[/url]
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3/
./configure
make
make install
rpm -qa | grep glibc-common 返回
glibc-common-2.3.4-2.25
rpm -qa | grep glibc 返回
glibc-2.3.4-2.25
rpm -qa | grep freetype 返回
freetype-2.1.9-1
freetype-devel包
第三张碟 中的freetype-devel-2.1.9-1.i386.rpm
rpm -ivh freetype-devel-2.1.9-1.i386.rpm
rpm -qa | grep libjpeg 返回
libjpeg-6b-33
libjpeg-devel包
第三张碟 中的libjpeg-devel-6b-33.i386.rpm
rpm -ivh libjpeg-devel-6b-33.i386.rpm
rpm -qa | grep zlib 返回
zlib-1.2.1.2-1.2
zlib-devel-1.2.1.2-1.2
rpm -qa | grep libpng 返回
libpng-1.2.7-1.el4.2
libpng10-1.0.16-1
libpng-devel包
第三张碟 libpng-devel-1.2.7-1.el4.2.i386.rpm
rpm -ivh libpng-devel-1.2.7-1.el4.2.i386.rpm
rpm -qa | grep gd 返回
gd-2.0.28-4.4E.1
libgd-devel包
第三涨碟gd-devel-2.0.28-4.4E.1.i386.rpm
rpm -ivh gd-devel-2.0.28-4.4E.1.i386.rpm
在原来没有安装gd包时,在configure nagios时应该要报错如下:
*** GD, PNG, and/or JPEG libraries could not be located... *********
Boutell's GD library is required to compile the statusmap, trends
and histogram CGIs. Get it from [url]http://www.boutell.com/gd/[/url], compile
it, and use the --with-gd-lib and --with-gd-inc arguments to specify
the locations of the GD library and include files.
NOTE: In addition to the gd-devel library, you'll also need to make
sure you have the png-devel and jpeg-devel libraries installed
on your system.
NOTE: After you install the necessary libraries on your system:
1. Make sure /etc/ld.so.conf has an entry for the directory in
which the GD, PNG, and JPEG libraries are installed.
2. Run 'ldconfig' to update the run-time linker options.
3. Run 'make clean' in the Nagios dblistribution to clean out
any old references to your previous compile.
4. Rerun the configure script.
NOTE: If you can't get the configure script to recognize the GD libs
on your system, get over it and move on to other things. The
CGIs that use the GD libs are just a small part of the entire
Nagios package. Get everything else working first and then
revisit the problem. Make sure to check the nagios-users
mailing list archives for possible solutions to GD library
problems when you resume your troubleshooting.
********************************************************************
回到nagios安装时解压开的目录
cd /usr/local/nagios
make devclean
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
终于好了:)
09:53 浏览 (59) 评论 (0) 分类: Linux入门 2010-01-05
缩略显示LINUX安装nagios监控软件(一)简单配置
文章分类:操作系统
LINUX安装nagios监控软件(一)简单配置
参考文档
[url]http://nagios.sourceforge.net/docs/3_0/quickstart-opensuse.html[/url]
先确认redhat上是否已经安装了apache2和C/C++ 的development libraries
httpd -v
返回:
Server version: Apache/2.0.52
Server built: May 24 2006 11:45:10
然后用“添加/删除应用程序”工具安装所有开发相关的包
第一步 新增账号信息
新增用户
useradd -m nagios
passwd nagios
新增用户组
usermod -G nagios nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data
第二步 下载nagios和插件
[url]http://www.nagios.org/download/core/[/url]
下载core,nagios-3.1.2.tar.gz
[url]http://www.nagios.org/download/plugins/[/url]
下载plugin,nagios-plugins-1.4.13.tar.gz
第三步 编译安装nagios
tar xzvf nagios-3.1.2.tar.gz
mv nagios-3.1.2/ /usr/local/nagios
cd /usr/local/nagios/
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
第四步 自定义设置
示例配置文件在/usr/local/nagios/etc
修改配置文件/usr/local/nagios/etc/objects/contacts.cfg,将告警邮件发向自己的邮箱
vi /usr/local/nagios/etc/objects/contacts.cfg
第五步 配置WEB
将nagios配置文件拷贝到apache
make install-webconf
新增nagiosadminWEB的用户名和密码等
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
重启apache应用
service httpd restart
第六步 安装插件
tar zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
第七步 启动服务
chkconfig --add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
启动成功,访问 http://ip/nagios
发现登陆不上,报错如下:
Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
查看配置文件
vi /etc/httpd/conf.d/nagios.conf
cd /usr/local/nagios/etc
查看文件,原来这个.users文件的权限是root,可能apache访问不了哟。修改下试试
-rw-r--r-- 1 root root 26 12月 23 15:51 htpasswd.users
查看apache日志
cd /var/log/httpd
tail -f error_log,登陆的时候报错如下:
[Wed Dec 23 16:22:38 2009] [error] [client 10.206.19.254] (13)Permission denied: Could not open password file: /usr/local/nagios/etc/htpasswd.users
网上说是selinux的原因,于是我做如下操作关闭selinux
命令:setenforce 0
再次访问就OK了,可以正常登陆,但是点击某些页面时有如下提示:
It appears as though you do not have permission to view information for any of the hosts you requested...
vi /usr/local/nagios/etc/cgi.cfg
修改use_authentication=1为use_authentication=0
service nagios restart 重启后就OKl了:)
页:
[1]