Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x HP交换机的SNMP_Python 3.x - Fatal编程技术网

Python 3.x HP交换机的SNMP

Python 3.x HP交换机的SNMP,python-3.x,Python 3.x,假设我运行这个命令来获取任何设备的代码: snmpwalk-V2C-c公共192.168.0.5.1.3.6.1.4.1.11.2.3.9.4.2.1.2.2.2 所以我的结果是这样的: 修订版KB.16.02.0014,ROM KB.16.01.0006(/ws/swbuildm/rel_spokane_qaoff/code/build/bom(swbuildm_rel_spokane_qaoff_rel_spokane)) 我需要在我的代码中添加函数,以便仅将结果手动填充到修订版KB.16.

假设我运行这个命令来获取任何设备的代码:

snmpwalk-V2C-c公共192.168.0.5.1.3.6.1.4.1.11.2.3.9.4.2.1.2.2.2

所以我的结果是这样的:

修订版KB.16.02.0014,ROM KB.16.01.0006(/ws/swbuildm/rel_spokane_qaoff/code/build/bom(swbuildm_rel_spokane_qaoff_rel_spokane))

我需要在我的代码中添加函数,以便仅将结果手动填充到修订版KB.16.02.0014???我不需要:ROM KB.16.01.0006(/ws/swbuildm/rel\u spokane\u qaoff/code/build/bom(swbuildm\u rel\u spokane\u qaoff\u rel\u spokane))


任何建议

假设x=revision KB.16.02.0014,ROM KB.16.01.0006(/ws/swbuildm/rel\u spokane\u qaoff/code/build/bom(swbuildm\u rel\u spokane\u qaoff\u rel\u spokane))如何将x值仅更改为revision KB.16.02.0014?这与python有何关系?您是否正在从命令行运行
snmpwalk
?如果是这样的话,什么操作系统?现在我正在Linux服务器Ubuntu中运行SNMP walk…但是我可以在另一个Python代码中插入OID以获得相同的结果。如果你想删除逗号后的所有内容,谷歌“Python字符串按逗号拆分”?