Add SNMP v2c probing and results endpoint.
Probe sysName/sysDescr/sysObjectID for alive hosts, persist SNMP outcomes, and expose scan SNMP data via REST. Made-with: Cursor
This commit is contained in:
@@ -7,6 +7,8 @@ type Config struct {
|
||||
DBDSN string
|
||||
StoreBackend string
|
||||
RunMigrations bool
|
||||
SNMPEnabled bool
|
||||
SNMPCommunity string
|
||||
}
|
||||
|
||||
func FromEnv() Config {
|
||||
@@ -29,11 +31,21 @@ func FromEnv() Config {
|
||||
if os.Getenv("RUN_MIGRATIONS") == "false" {
|
||||
runMigrations = false
|
||||
}
|
||||
snmpEnabled := true
|
||||
if os.Getenv("SNMP_ENABLED") == "false" {
|
||||
snmpEnabled = false
|
||||
}
|
||||
snmpCommunity := os.Getenv("SNMP_COMMUNITY")
|
||||
if snmpCommunity == "" {
|
||||
snmpCommunity = "public"
|
||||
}
|
||||
|
||||
return Config{
|
||||
HTTPAddr: addr,
|
||||
DBDSN: dbDSN,
|
||||
StoreBackend: storeBackend,
|
||||
RunMigrations: runMigrations,
|
||||
SNMPEnabled: snmpEnabled,
|
||||
SNMPCommunity: snmpCommunity,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user