如何在Ubuntu 12.04和Monitor远程主机上安装icinga?
如何在Ubuntu Server 12.04上安装最新的icinga和icinga-web以及如何监控远程主机?
安装必要的软件
让我们从安装dbconfig-common开始。 在安装剩余软件期间使用此程序包来询问用户有关数据库访问的问题
apt-get install dbconfig-common
现在安装Icinga和Iciga-Idoutils软件包,这应该也会安装很多依赖项
apt-get install python-software-properties add-apt-repository ppa:formorer/icinga apt-get update
安装icinga
apt-get install icinga icinga-idoutils mysql-server libdbd-mysql mysql-client
在安装过程中,您需要为Postfix提供参数,选择默认的Internet站点和MySQL root用户的密码 。 请务必提供有效的答案,因为信息将写入多个文件,之后更改它们很烦人。
现在第一部分已经完成,您应该已经能够使用用户名’icingaadmin’和您在安装过程中输入的密码访问http://yourhostname.com/icinga上的Icinga安装。
配置idoutils和ido2db
要启用ido2db,请编辑/ etc / default / icinga并将IDO2DB设置为“yes” 。
如果要安装icinga 1.7.1 ++,则需要手动创建文件
cd /etc/icinga/modules nano idoutils.cfg
现在粘贴以下行。
define module{ module_name idomod module_type neb path /usr/lib/icinga/idomod.so args config_file=/etc/icinga/idomod.cfg }
对于安全方也行
ln -s /usr/lib/icinga/idomod.so /usr/sbin/
更新
nano /etc/default/icinga
编辑IDO2DB =否为是
IDO2DB=yes
并运行
/etc/init.d/ido2db start /etc/init.d/icinga restart
查看/ var / log / syslog
配置Icinga以发送电子邮件
编辑
nano /etc/icinga/objects/contacts_icinga.cfg
更改
root@localhost to your-email-address
Icinga的Web
add-apt-repository ppa:formorer/icinga-web apt-get update apt-get install icinga-web
http://yourhostname.com/icinga-web
完成
从服务器监视远程主机
您需要在远程服务器上安装的唯一想法是nrpe和nagios-plugins
在这个例子中,我的远程主机是一个freeBSD服务器,我想远程监控它
pkg_add -r nagios-plugins nrpe
在/etc/rc.conf
文件中,添加一行以启用nrpe2守护程序。
nrpe2_enable="YES"
组态
在/usr/local/etc
目录中,将nrpe.cfg-sample
文件复制到名为nrpe.cfg
的文件中。 使用chmod u+x nrpe.cfg
命令为root用户添加写权限。
在文本编辑器中打开文件,然后查找allowed_hosts=127.0.0.1
行。 指向Nagios服务器的地址。
allowed_hosts=127.0.0.1,icinga-server-ip
启动NRPE守护程序。
/usr/local/etc/rc.d/nrpe2 start
现在回到Icinga Server
cd /etc/icinga/objects
编辑
nano localhost_icinga.cfg define host{ use generic-host ; Name of host template to use host_name localhost alias localhost address 127.0.0.1 }
在其下添加另一个主机。 FreeBSD服务器
define host{ use generic-host ; Name of host template to use host_name FreeBSD alias FreeBSD address ip-address-of-FreeBSD-server }
现在每个服务都定义你的主机由“,”localhost,FreeBSD分隔
host_name localhost,FreeBSD; 2主机名可能更依赖于您定义的主机
一项服务的示例
define service{ use generic-service ; Name of service template to use host_name localhost,FreeBSD service_description Disk Space check_command check_all_disks!20%!10% }
现在编辑hostgroups_icinga.cfg以监控HTTP和SSH
nano hostgroups_icinga.cfg define hostgroup { hostgroup_name http-servers alias HTTP servers members localhost,FreeBSD } # A list of your ssh-accessible servers define hostgroup { hostgroup_name ssh-servers alias SSH servers members localhost,FreeBSD }
现在重启icinga
/etc/init.d/icinga restart
现在转到http://yourhostname.com/icinga或http://yourhostname.com/icinga-web从Ubuntu监控您的远程主机
救命
http://www.meier.ws/2012/02/icinga-1-6-as-a-monitoring-solution-on-ubuntu-12-04-part-1-installation/ 找不到页面| 主页von Michael Meier。 回路机器
在FreeBSD 9.0上安装NRPE
在Ubuntu上使用IDOUtils设置Icinga – HowTos – Icinga Wiki
更新
BUG icinga不发送电子邮件。
编辑您的/ ets / hosts文件,如果看起来像这样
127.0.0.1 localhost xxxx-host-xxx xxx.xx.xx localhost xxxx-host-xxx FreeBSD