设为首页 收藏本站
查看: 1720|回复: 0

Centos+Nagios+NRPE+pnp4nagios

[复制链接]

尚未签到

发表于 2019-1-16 06:19:18 | 显示全部楼层 |阅读模式
  前一段工作需要配置一台监控服务器,就一路安装了Nagios. 为了避免我丢失 安装时候的记录,就先放在这里。事情太多,只能慢慢整理。我使用的是Centos6.2 mini安装的,在Nagios过程中需要安装的组件
perl wget make mailx sendmail vim xinetd  openssl-devel
  具体安装nagios的方法,在网上有说明文档http://nagios-cn.sourceforge.net/nagios-cn/
  其他网站上也有很多的安装手册,不再列出
  
安装 pnp4nagios-0.6.6 的时候出现   configure: error: Perl Module Time::HiRes not available
  yum install perl-Time-HiRes 即可解决
  下面是wget 地址,nagiso-3.3.1和nagios-plugins-1.4.15要安装的。

  http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz
  ./configure --with-command-group=nagcmd
http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
  http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
  http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
  给nagios安装nrpe插件报错: checking for SSL headers... configure: error: Cannot find ssl headers

  安装nrpe,编译的时候提示以下信息
checking for SSL headers... configure: error: Cannot find ssl headers
原因是缺少openssl-devel包,
yum -y install openssl-devel
问题解决!
  
http://sourceforge.net/projects/pnp4nagios/       pnp4nagios
http://docs.pnp4nagios.org/pnp-0.6/doc_completel
  http://docs.pnp4nagios.org/pnp-0.6/install
重启httpd
  我使用的是sendemail实现发送警告邮件的功能
  具体方法可参考http://linuxjcq.blog.运维网.com/3042600/717918
  安装nrpe的方法文档http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
  至于以下配置,在各个配置手册里都有详细的说明,保留只是为了记录我安装过程中的记录而已。
define host{
host_name Nagios-Server
alias Nagios Server
address 192.168.140.128
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r
}
define host{
host_name Nagios-Client
alias Nagios Client
address 192.168.140.129
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r
}
  
define hostgroup {
hostgroup_name Nagios-Example
alias Nagios Example
members Nagios-Server,Nagios-Clientesx
}
  define service {
host_name Nagios-Server
service_description check-host-alive
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check-host-alive
}
define service {
host_name Nagios-Clientesx
service_description check-host-alive
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check-host-alive
}
  define servicegroup{
servicegroup_name Host-Alive
alias Host Alive
members Nagios-Server,check-host-alive,Nagios-Clientesx,check-host-alive
}
  
#check nrpe
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
  
define host{
host_name Nagios-Server
alias Nagios Server
address 192.168.140.128
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r
  }
define host{
host_name Nagios-Client
alias Nagios Client
address 192.168.140.129
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r
}
  define hostgroup {
hostgroup_name Nagios-Example
alias Nagios Example
members Nagios-Server,Nagios-Client
}
  
define service {
host_name Nagios-Server
service_description check-host-alive
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check-host-alive
}
define service {
host_name Nagios-Client
service_description check-host-alive
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check-host-alive
}
  define servicegroup{
servicegroup_name Host-Alive
alias Host Alive
members Nagios-Server,check-host-alive,Nagios-Client,check-host-alive
}
  iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
  define host{
host_name Nagios-Server
alias Nagios Server
address 192.168.140.128
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-663706-1-1.html 上篇帖子: 基于fedora16的nagios环境搭建--个人日记(3)--nagios安装 下篇帖子: 基于fedora16的nagios环境搭建--个人日记(4)--飞信报警
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表