Add watchInterfaceEvents() listener

This commit is contained in:
Pim van Pelt
2025-06-23 19:02:02 +02:00
parent 42dbbded3d
commit 35165b0464
7 changed files with 124 additions and 201 deletions

View File

@@ -13,7 +13,7 @@ import (
"govpp-snmp-agentx/config"
"govpp-snmp-agentx/ifmib"
"govpp-snmp-agentx/logger"
"govpp-snmp-agentx/vppstats"
"govpp-snmp-agentx/vpp"
)
func main() {
@@ -41,7 +41,7 @@ func main() {
}
// Start VPP stats routine with callback to update MIB
vppstats.StartStatsRoutine(interfaceMIB.UpdateStats)
vpp.StartStatsRoutine(interfaceMIB.UpdateStats)
// Set up signal handling for graceful shutdown
sigChan := make(chan os.Signal, 1)
@@ -50,7 +50,7 @@ func main() {
// Wait for shutdown signal
<-sigChan
logger.Printf("Shutting down...")
// Flush any buffered log entries
logger.Sync()
}