Net-SNMP:如何在SET命令中以十六进制字节指定八位字节字符串? [英] Net-SNMP: how to specify octet string in Hex bytes in SET command?
问题描述
我将net-snmp-5.5-1.x86.exe用于Win32
I use net-snmp-5.5-1.x86.exe for Win32
我需要将IP地址设置为十六进制格式,并使用NET-SNMP set命令以空格分隔.例如,转换为十六进制格式的IP地址192.168.100.100为0xC0A86464
I need set IP addreess to hex format, separated by whitespace using NET-SNMP set command. For example, an IP address 192.168.100.100 converted to Hex format is 0xC0A86464
192.168.100.100 > 0xC0A86464
使用snmpget检查时,正确设置的值应返回以下值:
The correctly set value should return the following value when check with snmpget:
xxx-xxx-xxx-MIB::docsDevServerAddress.0 = Hex-STRING: C0 A8 64 64
我尝试过
snmpset -v 1 -c private 192.168.100.5 docsDevServerAddress.0 x 0xC0 A8 64 64
但是当我使用这种格式设置十六进制地址时,总是会出现如下错误:'A8: Bad object type: 6'
或'00xA8 Bad object type: 0'
,依此类推,具体取决于我尝试的十六进制格式.
根据NET-SNMP手册,"x"是十六进制字节的八位字节字符串,由空格分隔.
But when I using this format to set HEX address, I always got errors like this: 'A8: Bad object type: 6'
, or '00xA8 Bad object type: 0'
, and so on, depending on representation of hex format I tried.
According to NET-SNMP manual, 'x' is octet string in hex bytes, separated by whitespace.
如何为snmpset设置正确的字符串输入格式以设置所需的十六进制值?
How to set correct string input format for snmpset to set Hex values I need?
推荐答案
旧问题,但可能对其他人有用.
old question but maybe useful for others.
snmpset -v 1 -c private 192.168.100.5 docsDevServerAddress.0 x "C0 A8 64 64"
这篇关于Net-SNMP:如何在SET命令中以十六进制字节指定八位字节字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!