java - 使用 JVM SNMP 功能的读写访问可以做什么?

标签 java jvm snmp

我正在使用工具 described here 对 Java 应用程序进行 SNMP 监控。

ACL 模板有一个关于格式的部分,描述了 accessmanagers 选项的含义:

##############################################################
#               Format of the acl group
##############################################################
#
# communities: a list of SNMP community strings to which the
#              access control applies separated by commas.
#
# access: either "read-only" or "read-write".
#
# managers: a list of hosts to be granted the access rights.
#    Each can be expressed as any one of the following:
#    - hostname: hubble
#    - ip v4 and v6 addresses: 123.456.789.12 , fe80::a00:20ff:fe9b:ea82
#    - ip v4 and v6 netmask prefix notation: 123.456.789.0/24, 
#         fe80::a00:20ff:fe9b:ea82/64  
#      see RFC 2373 (http://www.ietf.org/rfc/rfc2373.txt)
#
# An example of two community groups for multiple hosts:
#    acl = {
#     {
#       communities = public, private
#       access = read-only
#       managers = hubble, snowbell, nanak
#     }
#     {
#       communities = jerry
#       access = read-write
#       managers = hubble, telescope
#     }
#    }

如果我授予管理器access = read-write,该管理器实际上可以在运行的 JVM 中写入或更改什么?

写访问是否允许管理器执行诸如触发 GC 或堆转储之类的操作?

最佳答案

您对 JVM SNMP 写入访问无能为力,但是可以调用 GC。

要查找 JVM 中可通过 SNMP 修改的所有内容,您可以浏览属于 JDK built-in SNMP server 的所有 Jvm*Meta 类。并寻找不平凡的 SnmpValue setter :

    public SnmpValue set(SnmpValue x, long var, Object data)

以下是 JDK 8u121 中所有可写 OID 的列表以及相应的 JMX 方法:

关于java - 使用 JVM SNMP 功能的读写访问可以做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41967535/

相关文章:

c - 无法使用 net-snmp c API 设置值

java - JAXB 与 Apache XMLBeans

java - com.fasterxml.jackson.core.JsonGenerator 类型无法解析。它是从所需的 .class 文件中间接引用的

java - System.out.println(16 >>> 3)?

java - 如何确保我使用的是 "server"JVM?

java - Java 字节码在同一版本的 Java 的不同更新中是否兼容?

gosnmp 从 SNMP PDU 中获取八位字节串

java - 格式标志转换不匹配异常

java - 我不知道如何更改我的程序以便我可以看到前十个最大的文件

c++ - 如何在 C++ 中使用 snmpwalk