** 使用nagios的前提是你已经正常的安装了apache
1. 安装nagios
写道
sudo apt-get install nagios3
** 安装过程中需要你输入一个邮箱地址,同时设置 nagios web 的登录密码 (初始帐号: nagiosadmin)
2. 查看安装版本
写道
xiaofei@xiaofei-O-E-M:~$ nagios3 --version
Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL
Website: http://www.nagios.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL
Website: http://www.nagios.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3. 启动nagios
写道
xiaofei@xiaofei-O-E-M:~$ sudo /etc/init.d/nagios3 start
* Starting nagios3 monitoring daemon nagios3
* already running! [ OK ]
* Starting nagios3 monitoring daemon nagios3
* already running! [ OK ]
4. 进入
写道
http://localhost/nagios3 (nagiosadmin/第一步中设置的密码)
5. 为nagios添加一些有用的插件 (参考 )
http://www.williamsang.com/archives/2060.html
** 上面链接在添加 pnp4nagios插件时,使用时会出现404错误 ,我这里需要 手动添加其apache.conf到/etc/apache2/conf-*下面去
写道
cd /etc/apache2/conf-available
sudo ln -sf ../../pnp4nagios/apache.conf pnp4nagios.conf
cd /etc/apache2/conf-enabled
sudo ln -sf ../conf-available/pnp4nagios.conf pnp4nagios.conf
sudo ln -sf ../../pnp4nagios/apache.conf pnp4nagios.conf
cd /etc/apache2/conf-enabled
sudo ln -sf ../conf-available/pnp4nagios.conf pnp4nagios.conf
6. 查看 localhost信息
7. 如何查看 使用 check_http 来监控 (本机地址(监控机): 10.10.10.145 , 被监控机 : 10.10.10.146 , 10.10.10.147)
首先 我们重定义一个 bbt_check_http
写道
cd /etc/nagios3/
** 在最后加上下面这段
define command{
command_name bbt_check_http
command_line $USER1$/check_http -H $HOSTNAME$ -I $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
}
** USER1 是预定义宏变量 , 其定义在 resource.cfg 中
** 在最后加上下面这段
define command{
command_name bbt_check_http
command_line $USER1$/check_http -H $HOSTNAME$ -I $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
}
** USER1 是预定义宏变量 , 其定义在 resource.cfg 中
接着我们开始定义对146,147机器的监控代码
写道
cd /etc/nagios3/conf.d/
sudo touch u146.cfg
sudo vim u146.cfg
sudo touch u146.cfg
sudo vim u146.cfg
define host{ use generic-host ; Name of host template to use host_name 10.10.10.146 alias u146 address 10.10.10.146 } define service{ use generic-service host_name 10.10.10.146 service_description http://10.10.10.146:8000/ check_command bbt_check_http!8000!'/'!10!20!30 }
** 147 的定义同 上面 146 , 在这里曾经走了不少弯路,开始一直在 bbt_check_http 这里加上 被控机器 的IP,结果一直不成功, 后来才知道 宏定义的变量 只需要在 define host里定义后此处就不需要了
参考 : http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=26660567&id=3810304
相关推荐
ubuntu 810下安装nagios安装说明,包括apache+php+mysql/nrpe/snmp/ndoutility/nagvis等的安装。
Ubuntu上Nagios安装过程.doc
ubuntu1410安装centreon+nagios3
Ubuntu 13.10 Server安装Nagios Core网络监控运用.docx
nagios 的安装 常见错误 以及一些需要注意的问题
suse11sp1 下安装nagios监控的安装记录文档。
Centos环境安装LAMP环境和nagios程式部署
自动安装Nagios Ubuntu,安装Nagios,Thruk,Grafana,InfluxDB,NagFlux,Histou 下载文件并编辑用于Histou配置的服务器IP。 202行将您的服务器IP放入Histou 安装后,在您的主机服务定义中添加下一行。 action_...
shell脚本安装nagios以及添加Windows监控主机在/usr/local/src 里面创建download 把压缩包里面的东西都放在里面 运行脚本
nagios监控,邮件告警、图文教程、内容详细易懂。 包含nagios的安装部署、nconf的安装部署、nconf与nagios联动实现nagios的监控项图像化配置,邮件告警配置等。
Linux下Nagios的安装与配置,详细说明开源软件Nagios的部署
nagios安装和配置全过程,具体到每一步,并加上个人安装配置心得!
nagios的安装和配置 nagios的安装和配置 nagios的安装和配置 nagios的安装和配置 nagios的安装和配置 nagios的安装和配置 nagios的安装和配置
CentOS配置Nagios监控平台,监控Linux客户端,Windows客户端详细配置,以及如何设置微信报警
nagios rpm 安装 配置 及部署 监控 nagios rpm 安装 配置 及部署 监控
使用nagios监控服务器,并将告警事件通过邮件发送给管理员
centos6.3下如何安装和配置nagios。
NAGIOS3.5详细安装说明,包括资源下载,安装步骤,对象配置等
nagios