🔍SNMP bugfix #690 + ⚙ settings saving improvemnts

This commit is contained in:
jokob-sk
2024-05-29 17:06:35 +10:00
parent e138840ecf
commit b0c47e824d
2 changed files with 35 additions and 11 deletions

View File

@@ -64,11 +64,12 @@ def main():
if len(tmpSplt) == 3:
ipStr = tmpSplt[0].split('.')[-4:] # Get the last 4 elements to extract the IP
macStr = tmpSplt[1].strip().split(' ') # Remove leading/trailing spaces from MAC
if 'iso.' in output and len(ipStr) == 4:
if len(ipStr) == 4:
macAddress = ':'.join(macStr)
ipAddress = '.'.join(ipStr)
@@ -82,6 +83,8 @@ def main():
extra = handleEmpty(line),
foreignKey = handleEmpty(macAddress) # Use the primary ID as the foreign key
)
else:
mylog('verbose', [f'[SNMPDSC] ipStr does not seem to contain a valid IP:', ipStr])
mylog('verbose', ['[SNMPDSC] Entries found: ', len(plugin_objects)])