I am unable to get snmp usng pysnmp7 - cryptography and pycryptodome installed.
Getting Error Indication: Ciphering services
Referring Ciphering services not available error on pysnmp v3 walk did not help.
$# pip show pysnmp
Name: pysnmp
Version: 7.1.16
$:/etc/zabbix# pip show cryptography
Name: cryptography
Version: 42.0.5
$# pip show pycryptodome
Name: pycryptodome
Version: 3.21.0
import asyncio
from pysnmp.hlapi.v3arch.asyncio import *
async def main():
iterator = get_cmd(
SnmpEngine(),
UsmUserData(
'admin',
authKey='privateprivate',
privKey='privateprivate',
authProtocol=usmHMACMD5AuthProtocol,
privProtocol=usmDESPrivProtocol
),
await UdpTransportTarget.create(("10.20.7.108", 161)),
ContextData(),
ObjectType(ObjectIdentity('1.3.6.1.4.1.248.11.22.1.8.10.2.0')),
)
errorIndication, errorStatus, errorIndex, varBinds = await iterator
print(f"Error Indication: {errorIndication}, Error Status: {errorStatus}, Error Index: {errorIndex}")
print(f"VarBinds: {varBinds}")
if __name__ == '__main__':
try:
asyncio.run(main())
except RuntimeError:
pass # to avoid RuntimeError: Event loop is closed
print('out')
Output is
Error Indication: Ciphering services not available, Error Status: 0, Error Index: 0
VarBinds: ()
out
I am unable to get snmp usng pysnmp7 - cryptography and pycryptodome installed.
Getting Error Indication: Ciphering services
Referring Ciphering services not available error on pysnmp v3 walk did not help.
$# pip show pysnmp
Name: pysnmp
Version: 7.1.16
$:/etc/zabbix# pip show cryptography
Name: cryptography
Version: 42.0.5
$# pip show pycryptodome
Name: pycryptodome
Version: 3.21.0
import asyncio
from pysnmp.hlapi.v3arch.asyncio import *
async def main():
iterator = get_cmd(
SnmpEngine(),
UsmUserData(
'admin',
authKey='privateprivate',
privKey='privateprivate',
authProtocol=usmHMACMD5AuthProtocol,
privProtocol=usmDESPrivProtocol
),
await UdpTransportTarget.create(("10.20.7.108", 161)),
ContextData(),
ObjectType(ObjectIdentity('1.3.6.1.4.1.248.11.22.1.8.10.2.0')),
)
errorIndication, errorStatus, errorIndex, varBinds = await iterator
print(f"Error Indication: {errorIndication}, Error Status: {errorStatus}, Error Index: {errorIndex}")
print(f"VarBinds: {varBinds}")
if __name__ == '__main__':
try:
asyncio.run(main())
except RuntimeError:
pass # to avoid RuntimeError: Event loop is closed
print('out')
Output is
Error Indication: Ciphering services not available, Error Status: 0, Error Index: 0
VarBinds: ()
out
You are using an old version of cryptography
. If you upgrade to 43.0.x releases, things should work well,
https://github.com/lextudio/pysnmp/blob/v7.1.16/pyproject.toml#L53
BTW, pycryptodome
dependency has been completely removed (since 7.1.4) if you check the release notes,
https://github.com/lextudio/pysnmp/blob/v7.1.16/CHANGES.rst
pip
used. – Lex Li Commented Jan 31 at 17:09