icinga +pnp4nagios

发布时间:2020-06-07 01:56:56 作者:amwuqd
来源:网络 阅读:591

icinga中文包:http://sourceforge.net/projects/icinga-cn/files/icinga-cn/

icinga英文包:https://www.icinga.org/download/packages/


1.安装icinga说需要的包

#> yum install httpd gcc glibc glibc-common gd gd-devel
#> yum install libjpeg libjpeg-devel libpng libpng-devel
#> yum install net-snmp net-snmp-devel net-snmp-utils


2.安装icinga(icinga-cn-1.9以这个为案例)

 2.1 添加icinga运行的相关用户和组

 2.2 编译安装

#> /usr/sbin/useradd -m icinga
 #> passwd icinga
 #> /usr/sbin/groupadd icinga
 #> /usr/sbin/groupadd icinga-cmd
 #> /usr/sbin/usermod -a -G icinga-cmd icinga
 #> /usr/sbin/usermod -a -G icinga-cmd www-data
 #> cd /usr/src/
 #> tar xvzf icinga-1.9.tar.gz
 #> cd icinga-1.9
#> ./configure --with-command-group=icinga-cmd --disable-idoutils
 #> make all
 #> make install
 #> make install-init
 #> make install-config
 #> make install-eventhandlers
 #> make install-commandmode
#> make install-config
 #> vi /usr/local/icinga/etc/objects/contacts.cfg
 #> make cgis
 #> make install-cgis
 #> make install-html
 #> make install-webconf
 #> htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin
 #> htpasswd /usr/local/icinga/etc/htpasswd.users <USERNAME>
 #> service httpd restart

3.安装Nagios-plugin

#> cd /usr/src
#> tar xvzf nagios-plugins-1.4.16.tar.gz
#> cd nagios-plugins-1.4.16
#> ./configure \
   --prefix=/usr/local/icinga --with-cgiurl=/icinga/cgi-bin \
   --with-nagios-user=icinga --with-nagios-group=icinga
#> make
#> make install

4.设置防火墙和selinux

 4.1这里测试就清空iptbales :iptables -F

#> getenforce
Set SELinux in "permissive" mode
 #> setenforce 0
 #> chcon -R -t httpd_sys_script_exec_t /usr/local/icinga/sbin/
 #> chcon -R -t httpd_sys_content_t /usr/local/icinga/share/
 #> chcon -R -t httpd_sys_script_rw_t /usr/local/icinga/var/rw/

5.设置开启启动项

#> chkconfig --add icinga
 #> chkconfig icinga on
验证下配置文件是否正确
 #> /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg
或: #> /etc/init.d/icinga show-errors
启动 icinga
 #> /etc/init.d/icinga start


6.访问

http://yourdomain.com/icinga/


7.Nrpe的安装

#> yum install openssl openssl-devel
 #> wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz -O nrpe.tgz
 #> tar xzf nrpe.tgz
 #> cd icinga-nrpe
 #> ./configure
 #> make all
 #> make install-plugin
FirstTest:
 #> /usr/src/icinga-nrpe/src/nrpe -n \
    -c /usr/src/icinga-nrpe/sample-config/nrpe.cfg -d
 #> /usr/local/icinga/libexec/check_nrpe -H 127.0.0.1 -n

8.PNPnagios的安装

yum install rrdtool -y
wget http://cdnetworks-kr-1.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.6.tar.gz
tar -xvzf pnp4nagios-0.6.6.tar.gz
cd pnp4nagios-0.6.6
./configure --with-nagios-user=icinga --with-nagios-group=icinga
make all
make install
make install-webconf
make install-config
make install-init

9.配置pnpnagios:

  参照下面链接配置:

http://docs.icinga.org/latest/en/icinga-web-pnp.html#idp12815568


nagios-snmp

wget http://nchc.dl.sourceforge.net/project/nagios-snmp/nagios-snmp-plugins/1.1.1/nagios-snmp-plugins.1.1.1.tgz

安装snmp

1) By CPAN (best)

on command line, as root :

[your_host]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled
cpan> install Net::SNMP

tar xf nagios-snmp-plugins

cd nagios_plugins/

sh install.sh

 输入安装的相关参数。


参考:

nagios 的snmp插件用法:http://nagios.manubulon.com/index_commands.html#load


https://wiki.icinga.org/display/howtos/Setting+up+PNP+with+Icinga#SettingupPNPwithIcinga-RRDToolandPerlBindings

icinga +pnp4nagios

参考文档:

http://docs.icinga.org/latest/en/quickstart-idoutils.html

http://docs.icinga.org/latest/en/


附录:nagios +pnp的文档:

http://wenku.baidu.com/view/4daf21a0284ac850ad02426c.html

pnp4nagios监控网卡流量:http://www.xmydlinux.org/201011/51.html

check_linux_stats:http://storysky.blog.51cto.com/628458/696749

http://blog.sina.com.cn/s/blog_6eee53080101a1dm.html







推荐阅读:
  1. nagios结合pnp4nagios图表
  2. pnp4nagios的安装

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

icinga +pnp 4nagios na

上一篇:USB端口管控应用解决方案

下一篇:网络设备验收

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》