- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 centos 7 上安装了 python3,因为我应该开始将我的脚本从 python 2 移动到 3。
yum install python3
# rpm -qa |grep python3
python3-libs-3.6.8-13.el7.x86_64
python3-setuptools-39.2.0-10.el7.noarch
python3-pip-9.0.3-7.el7_7.noarch
python3-3.6.8-13.el7.x86_64
我有一个导入 netsnmp 并使用它的脚本。在 python 2 下工作正常,但在 python 3 下不行。
# rpm -qa |grep python |grep -i snmp
net-snmp-python-5.7.2-48.el7_8.1.x86_64
在 python3 下我得到这个错误:
Traceback (most recent call last):
File "up.py", line 52, in <module>
oid = netsnmp.Varbind('.1.3.6.1.2.1.1.5.0')
AttributeError: module 'netsnmp' has no attribute 'Varbind'
有没有办法让 netsnmp 在 centos 7 下与 python 3 一起工作,而无需大惊小怪且不会破坏任何东西?
最佳答案
赶紧跑。
yum install python2 -y
然后
yum install python36 -y
它应该可以工作,因为它覆盖或更新了所需的依赖项。
关于python - 用于 python 3 的 Centos 7 和 netsnmp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63349360/
我有一个简单的例子: import netsnmpvar = netsnmp.Varbind('ifHCInOctets','0')res = netsnmp.snmpgetnext(var,Vers
我正在尝试使用 snmpwalk 在某些界面上获取一些信息和统计数据。我用这个: import netsnmp serv = "172.16.1.1" snmp_pass = "private" oi
我正在尝试向 SNMP 代理添加新服务。我目前正在使用 SNMP v2 并且当前正在运行代理,但是,当我尝试使用 snmpwalk 发送请求时,出现以下错误:“此 OID 当前不存在此类实例”。我拥有
当我尝试运行 python 脚本时,收到“ImportError:没有名为 netsnmp 的模块”消息。有人可以帮我吗?我没有任何 python 脚本编写经验。 这是我想使用的 Icinga 插件脚
我从 net-snmp 库中得到一个 snmp get 错误 Operation not permitted error from sendto. 我想知道是什么导致 sendto(2) 系统调用失败
我正在尝试使用 netsnmp 中的 snmpset 来设置 Counter32 类型的 OID 值,但我不知道要指定哪种数据类型? 查看 ./snmpset -h 我看到以下内容: TYPE:
我收到此错误 fatal error: net-snmp/net-snmp-config.h: No such file or directory。我已经安装了 gcc、python-devel、ne
我使用的是 Debian 6.0 和 net-snmp 5.4.3。我有一个关于捕获系统上存在的以太网接口(interface)的 IP 地址和 MAC 地址的问题。在我的 SNMP 代理中,我必须弄
我在 centos 7 上安装了 python3,因为我应该开始将我的脚本从 python 2 移动到 3。 yum install python3 # rpm -qa |grep python3 p
我正在尝试在 python 中使用 netsnmp,但在遵循与 python 中的 netsnmp 相关的所有建议后,它无法导入。我使用以下命令安装了 netsnmp yum install net-
我在 Ubuntu 上成功编译了 net-snmp-5.7.3。 :D 这是 Ubuntu 的特定版本: Linux loserBox 3.13.0-32-generic #57-Ubuntu SMP
我是一名优秀的程序员,十分优秀!