initial in new branch

This commit is contained in:
Wolfgang Hottgenroth 2025-03-10 10:59:27 +01:00
parent af30d5ec57
commit 9d8aa63bed
4 changed files with 25 additions and 3 deletions

21
snippets/ntp/test02.py Normal file
View File

@ -0,0 +1,21 @@
import ntp.packet
import json
session = ntp.packet.ControlSession()
session.openhost('localhost')
peers = session.readstat()
k = []
l = session.readvar(0)
print(f"{l=}")
k.append(list(dict(l).keys()))
for p in peers:
l = session.readvar(p.associd)
print(f"{p.associd}: {dict(l)}")
k.append(list(dict(l).keys()))
print(json.dumps(k, indent=4))

View File

@ -17,7 +17,8 @@ hottis MODULE-IDENTITY
hottisNtpsec OBJECT IDENTIFIER ::= { hottis 123 }
local OBJECT IDENTIFIER ::= { hottisNtpsec 1 }
peers OBJECT IDENTIFIER ::= { hottisNtpsec 2 }
system OBJECT IDENTIFIER ::= { hottisNtpsec 2 }
peers OBJECT IDENTIFIER ::= { hottisNtpsec 3 }
ntpsecLocalLeap OBJECT-TYPE

View File

@ -26,7 +26,7 @@ NUMBER_OF_PEERS_PREFIX = PEERS_PREFIX + '.1'
# 2 is the prefix
# the first 1 is for the table in the mib
# the second 1 is for the entries in the table in the mib
TABLE_OF_PEERS_PREFIX = PEERS_PREFIX + '.2.1'
TABLE_OF_PEERS_PREFIX = PEERS_PREFIX + '.3.1'
def int_scale1k(x):