I have started implementing notification support in ntpsnmpd, however I have been unable to get it working so far. I do not believe there is an error in the packet encoding, but there must be a problem somewhere in my code as the master agent only ever returns responses with error 268 (processing error).

I have tested my SNMP configuration to see if other traps work; they do. And if information on SNMP is lacking in the first place, information on sub-agent trap implementation is downright non-existent. I have not been able to look at the net-snmp code enough to figure out what it is doing yet either.

Representative example of the Notify packets I am sending (class and string versions):

NotifyPDU(bigEndian=True, context='public', packetID=100000, pduType=12, sessionID=15, transactionID=30000, varbinds=[Varbind(vtype=6, oid=OID((1, 3, 6, 1, 6, 3, 1, 1, 4, 1), False), payload=OID((1, 3, 6, 1, 2, 1, 197, 0, 8), False)), Varbind(vtype=66, oid=OID((1, 2, 6, 1, 2, 1, 197, 0, 1, 4, 1), False), payload=10)])

'\x01\x0c\x18\x00\x00\x00\x00\x0f\x00\x00u0\x00\x01\x86\xa0\x00\x00\x00t\x00\x00\x00\x06public\x00\x00\x00\x06\x00\x00\x05\x06\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x04\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x00\x00\x00\x00\x08\x00B\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\n'

The response I get back:

ResponsePDU(bigEndian=True, packetID=100000, pduType=18, resError=268, resIndex=0, sessionID=15, sysUptime=886854, transactionID=30000, varbinds=(Varbind(vtype=6, oid=OID((1, 3, 6, 1, 6, 3, 1, 1, 4, 1), False), payload=OID((1, 3, 6, 1, 2, 1, 197, 0, 8), True)), Varbind(vtype=66, oid=OID((1, 2, 6, 1, 2, 1, 197, 0, 1, 4, 1), False), payload=10)))

'\x01\x12\x10\x00\x00\x00\x00\x0f\x00\x00u0\x00\x01\x86\xa0\x00\x00\x00p\x00\r\x88F\x01\x0c\x00\x00\x00\x06\x00\x00\x05\x06\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x04\x02\x01\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x00\x00\x00\x00\x08\x00B\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\n'

--
/"In the end; what separates a Man, from a Slave? Money? Power? No. A Man Chooses, a Slave Obeys."/ -- Andrew Ryan

/"Utopia cannot precede the Utopian. It will exist the moment we are fit to occupy it."/ -- Sophia Lamb

_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to