AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-356792

TomKeegasi's questions

Martin Hope
TomKeegasi
Asked: 2019-06-08 08:22:50 +0800 CST

keepalived + snmp = 没有可用的对象

  • 0

我无法通过 snmp 查询 keepalived 状态的信息,我得到的只是以下错误:

$ snmpwalk -v 2c -c public localhost 1.3.6.1.4.1.9586.100.5
1.3.6.1.4.1.9586.100.5 = No Such Object available on this agent at this OID

或使用 mib 时:

$ snmpwalk -v 2c -c public 127.0.0.1 KEEPALIVED-MIB
KEEPALIVED-MIB: Unknown Object Identifier (Sub-id not found: (top) -> KEEPALIVED-MIB)

配置

SNMP-守护进程

snmpd 是版本 5.7.3

/etc/snmp/snmpd.conf

master agentx
agentaddress udp:127.0.0.1:161
rocommunity public 127.0.0.1

trapcommunity public 
trap2sink 127.0.0.1

保活

Keepalived 是 1.3.2 版本SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3

/etc/keepalived/keepalived.conf

# Managed by Puppet
global_defs {
  [...]

  snmp_socket udp:127.0.0.1:161
  enable_snmp_keepalived
  enable_traps
}

[...]

/etc/default/keepalived

DAEMON_ARGS="--snmp"

服务

以下是日志输出,对我来说看起来不错。这是以下结果:systemctl start snmpd; systemctl restart keepalived

# Here snmpd is starting
Jun 07 18:12:42 vhrz1250 systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Jun 07 18:12:42 vhrz1250 systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon..
Jun 07 18:12:42 vhrz1250 snmpd[41254]: error on subcontainer 'ia_addr' insert (-1)
Jun 07 18:12:42 vhrz1250 snmpd[41254]: Turning on AgentX master support.
Jun 07 18:12:42 vhrz1250 snmpd[41254]: NET-SNMP version 5.7.3

# Here keepalived seems to be preparing for shutdown
Jun 07 18:12:56 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:58059->[127.0.0.1]:161
Jun 07 18:12:56 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:44178->[127.0.0.1]:161
Jun 07 18:13:05 vhrz1250 systemd[1]: Stopping Keepalive Daemon (LVS and VRRP)...
Jun 07 18:13:05 vhrz1250 Keepalived[38575]: Stopping
Jun 07 18:13:05 vhrz1250 Keepalived_healthcheckers[38576]: Stopped
Jun 07 18:13:05 vhrz1250 Keepalived_vrrp[38578]: VRRP_Instance(VI_10) sent 0 priority
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[38578]: Stopped
Jun 07 18:13:06 vhrz1250 Keepalived[38575]: Stopped Keepalived v1.3.2 (12/03,2016)
Jun 07 18:13:06 vhrz1250 systemd[1]: Stopped Keepalive Daemon (LVS and VRRP).

# Here keepalived stopped and spins back up again
Jun 07 18:13:06 vhrz1250 systemd[1]: Starting Keepalive Daemon (LVS and VRRP)...
Jun 07 18:13:06 vhrz1250 Keepalived[41293]: Starting Keepalived v1.3.2 (12/03,2016)
Jun 07 18:13:06 vhrz1250 Keepalived[41293]: Setting default script user to 'keepalived_script', uid:gid 1000:1000
Jun 07 18:13:06 vhrz1250 Keepalived[41293]: Opening file '/etc/keepalived/keepalived.conf'.
Jun 07 18:13:06 vhrz1250 Keepalived[41295]: Starting Healthcheck child process, pid=41296
Jun 07 18:13:06 vhrz1250 Keepalived[41295]: Starting VRRP child process, pid=41297
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[41297]: Registering Kernel netlink reflector
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[41297]: Registering Kernel netlink command channel
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[41297]: Registering gratuitous ARP shared channel
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[41297]: Opening file '/etc/keepalived/keepalived.conf'.
Jun 07 18:13:06 vhrz1250 systemd[1]: Started Keepalive Daemon (LVS and VRRP).
Jun 07 18:13:06 vhrz1250 Keepalived_healthcheckers[41296]: Initializing ipvs

# Here keepalived starts SNMP subagent for vrrp
Jun 07 18:13:06 vhrz1250 Keepalived_vrrp[41297]: Starting SNMP subagent
Jun 07 18:13:06 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:52941->[127.0.0.1]:161

# Keepalived continues starting up
Jun 07 18:13:06 vhrz1250 Keepalived_healthcheckers[41296]: Registering Kernel netlink reflector
Jun 07 18:13:06 vhrz1250 Keepalived_healthcheckers[41296]: Registering Kernel netlink command channel
Jun 07 18:13:06 vhrz1250 Keepalived_healthcheckers[41296]: Opening file '/etc/keepalived/keepalived.conf'.

# Here keepalived starts SNMP subagent for healthchecks
Jun 07 18:13:06 vhrz1250 Keepalived_healthcheckers[41296]: Starting SNMP subagent
Jun 07 18:13:06 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:53980->[127.0.0.1]:161

# Keepalived continues starting up
Jun 07 18:13:07 vhrz1250 Keepalived_healthcheckers[41296]: Using LinkWatch kernel netlink reflector...
Jun 07 18:13:07 vhrz1250 Keepalived_vrrp[41297]: Using LinkWatch kernel netlink reflector...
Jun 07 18:13:08 vhrz1250 Keepalived_vrrp[41297]: VRRP_Instance(VI_10) Transition to MASTER STATE
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: VRRP_Instance(VI_10) Entering MASTER STATE
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: Opening script file /usr/local/bin/keepalived_statechange
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: VRRP_Instance(VI_10): Sending SNMP notification
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: VRRP_Instance(VI_10): Sending SNMP notification vrrpTrapNewMaster
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: VRRP_Instance(VI_10): Sending SNMP notification vrrpv3NotifyNewMaster, reason 2
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: Remote SMTP server [137.248.1.36]:25 connected.
Jun 07 18:13:10 vhrz1250 Keepalived_vrrp[41297]: SMTP alert successfully sent.

# This might be connections from the VRRP instance snmp subagents
Jun 07 18:13:12 vhrz1250 snmpd[41254]: error on subcontainer 'ia_addr' insert (-1)
Jun 07 18:13:22 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:50917->[127.0.0.1]:161
Jun 07 18:13:22 vhrz1250 snmpd[41254]: Connection from UDP: [127.0.0.1]:38560->[127.0.0.1]:161
snmp
  • 1 个回答
  • 1276 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve