![snmpget 在远程服务器上不起作用,但在从本地服务器本身调用时起作用](https://linux22.com/image/1073057/snmpget%20%E5%9C%A8%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%8C%E4%BD%86%E5%9C%A8%E4%BB%8E%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%9C%AC%E8%BA%AB%E8%B0%83%E7%94%A8%E6%97%B6%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在尝试从远程执行 snmpget,但它只能从服务器本身起作用:
server $ ipAddress=$(ip -4 -o a show dev enp1s0f0 | awk -F ' *|/' '{print$4;exit}')
server $ snmpget -v3 -u svc_snmp_v3 -l authNoPriv -a SHA-512 -A $MDP_SNMP_V3 $ipAddress sysName.0
SNMPv2-MIB::sysName.0 = STRING: server
remote $ ipAddress=x.y.z.t # The IP address of my server
remote $ snmpget -v3 -u svc_snmp_v3 -l authNoPriv -a SHA-512 -A $MDP_SNMP_V3 $ipAddress sysName.0
sysName.0: Unknown Object Identifier (Sub-id not found: (top) -> sysName)
remote $ echo $?
1
怎么了 ?