PLUGINS, NTFY, handleEmpty work⤵

This commit is contained in:
Jokob-sk
2023-10-19 08:08:24 +11:00
parent 1a3cf49c00
commit 5d64433be0
18 changed files with 594 additions and 128 deletions

View File

@@ -75,15 +75,14 @@ def main():
ipAddress = '.'.join(ipStr)
mylog('verbose', [f'[SNMPDSC] IP: {ipAddress} MAC: {macAddress}'])
plugin_objects.add_object(
primaryId=macAddress,
secondaryId=ipAddress.strip(), # Remove leading/trailing spaces from IP
watched1='(unknown)',
watched2=snmpwalkArgs[6], # router IP
extra=line,
foreignKey=macAddress # Use the primary ID as the foreign key
primaryId = handleEmpty(macAddress),
secondaryId = handleEmpty(ipAddress.strip()), # Remove leading/trailing spaces from IP
watched1 = '(unknown)',
watched2 = handleEmpty(snmpwalkArgs[6]), # router IP
extra = handleEmpty(line),
foreignKey = handleEmpty(macAddress) # Use the primary ID as the foreign key
)
mylog('verbose', ['[SNMPDSC] Entries found: ', len(plugin_objects)])