librenms/librenms-agent

Using check_mk dmi agent conflicts with discovery (causing flapping Hardware/Serial Numbers in logs)

Opened this issue · 1 comments

Issue: If you use the dmi check_mk agent, discovery will revert the changes that the agent make to the device's Serial Number and Hardware type. Once the dmi agent is re-executed, the Serial Number and Hardware type revert back to their "correct" values. LibreNMS logs are constantly updated with the flapping values as a result:

2023-09-15 06:35:25 | system | multi | Hardware: Generic x86 64-bit -> Xen HVM domU | System
2023-09-15 06:35:25 | system | multi | Serial: 4046632a-32d4-6ffa-7b8b-e0cfd30a3ed9 | System
2023-09-15 06:35:11 | system | multi | Hardware: Xen HVM domU -> Generic x86 64-bit | System
2023-09-15 06:35:11 | system | multi | Serial: 4046632a-32d4-6ffa-7b8b-e0cfd30a3ed9 -> | System

In the log entries above, the actions at 06:35:11 are taken during discovery of the device, and the actions at 06:35:25 are taken by polling the unix-agent dmi.

I'm not really familiar with the discovery process (LibreNMS/Modules/Core.php) and whether the unix-agent (the if (isset($agent_data['dmi'])) section in includes/polling/unix-agent.inc.php ) can be inherited to poll dmi data during discovery, but that would be the preferred method of discovery to prevent these values from flapping.

Seems like you are on the right track.