Archive for the ‘Nagios’ Category

nagios It appears as though you do not have permission to view information you requested…的解决

访问nagios的时候,查看详细信息是提示“It appears as though you do not have permission to view information you requested…”
解决方法:
vi  /usr/local/nagios/etc/cgi.cfg
修改
use_authentication=1

use_authentication=0
/etc/init.d/nagios restart 
为了保障系统的安全性,nagios设置了这个参数,默认为1,改为0即可

Read the rest of this entry »

nagios-3.0.6在redhat 中安装(1)

nagios-3.0.6在linux中安装部署
nagios的功能是监控服务和主机,但是他自身并不包括这部分功能的代码,所有的监控、检测功能都是有插件来完成的。再说报警功能,如果监控系统发现问题不能报警那就没有意义了,所以报警也是nagios很重要的功能之一。但是,同样的,nagios自身也没有报警部分的代码,甚至没有插件,而是交给用户或者其他相关开源项目组去完成。类似这样细致的工作,被nagios的开发人员称为dirty work(脏活)。其实脏活不脏,只是太细致了,对于nagios——一个负责监控工作的老板来说,细致的工作必然是交给他的员工去搞定啦。
所以我这里说的nagios安装,是指基本平台,也就是nagios软件包的安装。它是监控体系的框架,也是所有监控的基础。
一、安装准备
1、系统:redhat AS4U4
2、安装好apache gd库(apache安装在/usr/local/app/apache2)
3、下载软件安装包
到nagios官方网站:http://www.nagios.org/download/下载最新的安装包,本文使用是nagios-3.0.6.tar.gz,
插件包: nagios-plugins-1.4.13.tar.g
znrpe-2.12.tar.gz
4、创建帐号及组
useradd nagios
二、安装nagios
1、tar xzf nagios-3.0.6.tar.gz
2、./configure –prefix=/usr/local/nagios –enable-embedded-perl –with-nagios-user=nagios –with-nagios-group=nagios –with-gd-lib=/usr/local/lib/ –with-gd-inc=/usr/local/include/ –with-httpd-conf=/usr/local/app/apache2
make all
make install ## 使用make install来安装主程序,CGI和HTML文件
make install-init ## 使用make install-init在/etc/rc.d/init.d安装启动脚本
make install-config ## 使用make install-cofig来安装示例配置文件,安装的路径是/usr/local/nagios/etc/
3、检查
ls /usr/local/nagios/ ## bin etc sbin share var #看到这5个目录就ok了
4、生成http用户验证文件,用户名为nagios,记好密码
/usr/local/app/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagios
5、将nagios的信息加到apache中,打开/etc/httpd/conf/httpd.conf文件,在文件最后添加如下代码:
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName “Nagios Access”
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

Alias /nagios /usr/local/nagios/share

Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName “Nagios [...]

Read the rest of this entry »

nagios被监控机nrpe安装脚本

自动安装脚本install.sh如下
#!/bin/sh
tar zxf nagios-plugins-1.4.13.tar.gz
tar zxf nrpe-2.12.tar.gz
groupadd ngroup
useradd nuser -g ngroup -d /nonexistent -s /sbin/nologin
cd nagios-plugins-1.4.13
./configure –prefix=/opt/nagios –enable-perl-modules –with-nagios-user=nuser –with-nagios-group=ngroup
make
make install && cd -
cd nrpe-2.12
./configure –prefix=/opt/nagios –with-ssl –with-nrpe-user=nuser –with-nrpe-group=ngroup –with-nagios-user=nuser –with-nagios-group=ngroup
make all
make install-plugin
make install-daemon
make install-daemon-config && cd -
chown nuser:ngroup /opt/nagios
chown -R nuser:ngroup /opt/nagios/libexec
INTRANET=`ifconfig | grep -w -A 1 eth1 | grep ‘inet addr’ | head -1 | [...]

Read the rest of this entry »

nagios问题 NRPE: Command ‘check_disk’ not defined

状态信息: NRPE: Command ‘check_disk’ not defined
在命令行下:
[root@nagiosserver etc]# ../libexec/check_nrpe -H 192.168.1.12 -c check_disk
NRPE: Command ‘check_disk’ not defined
这个需要监控与被监控端命令配置要必须一致,否则就会出现如上的错误。
被监控机:
etc/nrpe.cfg
错误
command[check_hda1]=/opt/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1:
正确
command[check_disk]=/opt/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1

Read the rest of this entry »

CHECK_NRPE: Error – Could not complete SSL handshake 错误解决

CHECK_NRPE: Error – Could not complete SSL handshake
1、Different versions. Make sure you are using the same version of the check_nrpe plugin and the NRPE daemon. Newer versions of NRPE are usually not backward compatible with older versions.
2、SSL is disabled. Make sure both the NRPE daemon and the check_nrpe plugin were compiled with SSL support and [...]

Read the rest of this entry »