During the last monthly update, or if it was even before, the # character was added to for example the os field in the database. An os that previously was ‘comware’ is now ‘#comware’. That definitely feels like a big bug and it’s causing all sorts of problems. Can’t rerun discovery even, it just adds # to the OS after it runs.
Evidence? You want me to show the database? Sorry, but that’s not going to happen for a number of reasons…
I have not checked all OS fields but I can tell you that even if I change it back to ‘comware’ directly in the database, it will be back to ‘#comware’ on next discovery. I know it’s weird but it’s the same on my lab server as in production. I have also discovered other database records having a leading ‘#’ after the latest update.
I have no idea how that is even possible so that’s why I am asking.
I can add that we have a bit over 4000 devices, and roughly a little below 3000 comware devices. The only ones till having the correct OS are the ones that have been down since the update so it has to happen at discovery.
Sorry, but the https://p.libren.ms site keeps dying on me and I am not entitled to enclose any IP information, so I can’t share all of the information from a discovery. I have verified that the only OS this happens with are with Comware switches, the others don’t get the # added when the os field is set at discovery. I guess I have to reverse engineer where it sets that field in the discovery process if it’s not possible to get that help from here.
Here’s the information from validation from the lab server:
[OK] Composer Version: 2.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Locks are functional
[OK] No active python wrapper pollers found
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
I am well aware of the comware.yaml file but since the OS is seen as ‘#comware’ rather than ‘comware’, it doesn’t even read it during discovery. If I rename the file to ‘#comware.yaml’, then it runs, not otherwise. So the problem occurs before reading the yaml file.
I’ve done a workaround to fix this, but it’s not a permanent fix. I’ve pinned it down to the 24.12 update. I updated from 24.10 to 24.12. All sensor monitoring for comware switches got lost when I updated to 24.12, I have rrd files from before the date when I updated.
The workaround I did is that I edited LibreNMS/Modules/Core.php to add the following code from row 78:
if ($device->os == '#comware') {
$device->os = 'comware';
}
I don’t know enough about the core functions to analyze this more but this is at least working now and if I find the real reason behind this, I will change accordingly.