cacti+nagios之nagios的搭建(三)
2016-07-18 00:00
211 查看
摘要:cacti+nagios之nagios的搭建
cd/root/cactinagios
wgethttp://jaist.dl.sourceforge.net/project/nagios/nagios/nagios-4.x/nagios-4.0.7/nagios-4.0.7.tar.gz
tar–xfnagios-4.0.7.tar.gz
cdnagios-4.0.7
./configure–with-command-group=nagios--prefix=/var/www/html/nagios--enable-event-broker
makeall
makeinstall&&makeinstall-init&&makeinstall-config
makeinstall-commandmode&&makeinstall-webconf
设置登录web界面时http验证的账号密码:
htpasswd-c/var/www/html/nagios/etc/htpasswd.usersnagiosadmin
安装nagios-plugins
cd/root/cactinagios
Wgethttp://nagios-plugins.org/download/nagios-plugins-2.0.2.tar.gz
tar–xfnagios-plugins-2.0.2.tar.gz
cdnagios-plugins-2.0.2
./configure–with-nagios-user=nagios–with-nagios-group=nagios–prefix=/var/www/html/nagios–with-mysql
make
mkeinstall
附apache的配置说明:
找到apache的配置文件:/etc/httpd/httpd.conf
找到:
检查nagios的配置:
/var/www/html/nagios/bin/nagios-v/var/www/html/nagios/etc/nagios.cfg
添加自动启动:
chkconfig–addnagios
chkconfignagioson
servicenagiosstart
登陆页面:
http://localhost/nagios
nagios客户端的安装配置:
cd/yunwei
pssh-hip.txt"mkdir/yunwei"
pscp-hip.txtnagios-plugins-2.0.2.tar.gz
pssh-hip.txt"./configure--prefix=/usr/local/nagios"
pssh-hip.txt"make&&makeinstall"
pssh-hip.txt"chownnagios:nagios/usr/local/nagios"makeinstall-pluginpssh-hip.txt"wgethttp://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz"
tar-xfnrpe-2.13.tar.gz
cdnrpe-2.13
./configure
makeall
makeinstall-plugin
makeinstall-daemon
makeinstall-daemon-config
makeinstall-xinetd
再次查看nagios-plugins目录就会发现有5个目录了;
cat/etc/xinetd.d/nrpe
注意:only_from增加监控端主机的ip地址;
编辑/etc/services文件,增加NRPE服务
servicexinetdrestart
可以看到5566端口已经在监听了;
使用如下命令,测试客户端是否正常安装了nrpe插件
/usr/local/nagios/libexec/check_nrpe-Hlocalhost
在监控端,打开commands.cfg,编辑添加如下内容:
#'check_nrpe'commanddefinitiondefinecommand{command_namecheck_nrpe#定义命令名称为check_nrpe,在services.cfg中要使用这个名称.command_line
$USER1$/check_nrpe-H$HOSTADDRESS$-c$ARG1$#这是定义实际运行的插件程序.#这个命令行的书写要完全按照check_nrpe这个命令的用法,不知道用法的就用check_nrpe–h查看.}
-c后面带的$ARG1$参数是传给nrpedaemon执行的检测命令,之前说过了它必须是nrpe.cfg中所定义的那5条命令中的其中一条。在services.cfg中
使用check_nrpe的时候要用“!”带上这个参数。
cd/root/cactinagios
wget
tar–xfnagios-4.0.7.tar.gz
cdnagios-4.0.7
./configure–with-command-group=nagios--prefix=/var/www/html/nagios--enable-event-broker
makeall
makeinstall&&makeinstall-init&&makeinstall-config
makeinstall-commandmode&&makeinstall-webconf
设置登录web界面时http验证的账号密码:
htpasswd-c/var/www/html/nagios/etc/htpasswd.usersnagiosadmin
安装nagios-plugins
cd/root/cactinagios
Wget
tar–xfnagios-plugins-2.0.2.tar.gz
cdnagios-plugins-2.0.2
./configure–with-nagios-user=nagios–with-nagios-group=nagios–prefix=/var/www/html/nagios–with-mysql
make
mkeinstall
附apache的配置说明:
找到apache的配置文件:/etc/httpd/httpd.conf
找到:
检查nagios的配置:
/var/www/html/nagios/bin/nagios-v/var/www/html/nagios/etc/nagios.cfg
添加自动启动:
chkconfig–addnagios
chkconfignagioson
servicenagiosstart
登陆页面:
nagios客户端的安装配置:
cd/yunwei
pssh-hip.txt"mkdir/yunwei"
pscp-hip.txt
pssh-hip.txt"./configure--prefix=/usr/local/nagios"
pssh-hip.txt"make&&makeinstall"
pssh-hip.txt"chownnagios:nagios/usr/local/nagios"makeinstall-pluginpssh-hip.txt"wget
-c后面带的$ARG1$参数是传给nrpedaemon执行的检测命令,之前说过了它必须是nrpe.cfg中所定义的那5条命令中的其中一条。在services.cfg中
相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Linux 下无损图片压缩小工具介绍