温馨提示×

温馨提示×

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

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

Linux HA Heartbeat/Monitoring with Nagios

发布时间:2020-07-17 03:03:08 来源:网络 阅读:1749 作者:DevilRex119 栏目:移动开发
< Linux HA Heartbeat
Jump to: navigation, search

Contents

[hide]
  • 1Requirements

  • 2Linux HA Server

    • 2.1Script

    • 2.2Configuration


  • 3Nagios Server

    • 3.1template.cfg

    • 3.2host file


Requirements

You need to have a Nagios NRPE server running on the host.

The host need to have the command /usr/bin/cl_status accessible to user nrpe.

Linux HA Server

Script

The script will return a Nagios code of:

  • OK: when the number of registered nodes and active nodes is equal

  • WARNING: If at least one node is active

  • CRITICAL: If the cluster status could not be accessed or if no nodes are active

You can get it here: media:check_heartbeat.sh

Copy it to your nagios plugins directory, in my case: /usr/local/nagios/libexec/

# cp check_hearbeat.sh /usr/local/nagios/libexec/check_heartbeat.sh
# chmod 755 /usr/local/nagios/libexec/check_heartbeat.sh

Configuration

Add the following to /etc/nagios/nrpe_local.cfg

command[check_heartbeat]=/usr/local/nagios/libexec/check_heartbeat.sh

and reload nrpe server:

# /etc/init.d/nagios-nrpe-server reload

Nagios Server

template.cfg

Add the following template:

# check LVS Heartbeat
define service{
    use generic-service
    name check-heartbeat
    service_description Linux HA LVS
    check_command   check_nrpe!check_heartbeat
}

host file

Add the following service definition:

#check heartbeat
define service{
    use check-heartbeat
    host_name   lvs1, lvs2
}
Retrieved from "http://wiki.debuntu.org/wiki/Linux_HA_Heartbeat/Monitoring_with_Nagios"


向AI问一下细节

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

AI