Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Brother SNMP printer inventory (ifType) #836

Merged
merged 10 commits into from
Jan 31, 2025

Conversation

eduardomozart
Copy link
Contributor

@eduardomozart eduardomozart commented Jan 24, 2025

This commit improves the inventory of network ports of Brother printers. I have a HL-1210W printer which reports it's ifType as "iso88023Csmacd(7)" (Ethernet) instead of "ieee80211(71)" (Wireless). I'd opened a bug report with Brother but it's a common issue with other models as Brother QL-710W. It happens because Brother uses https://mibs.observium.org/mib/BROTHER-MIB/#brMultiIFConfigureTable to determine interface type. This PR queries those values and change the port type accordingly.
I also would like to know if it's possible to set the Wi-Fi Network which the printer belongs through netinventory tasks, so I could use $brpsWLanName->{(keys %{$brpsWLanName})[0]} as seen in ae8828b. The only solution I could found was renaming the interface name to reflect the Wi-Fi Network name, but if the interface name changes, the interface metrics history is "lost" (unassociated) since a new interface is created in GLPI.

Brother HL-1210W snmpwalk: snmpwalk-brother.txt

@eduardomozart eduardomozart marked this pull request as draft January 24, 2025 23:19
@eduardomozart eduardomozart marked this pull request as ready for review January 24, 2025 23:54
@eduardomozart eduardomozart changed the title Improve Brother SNMP printer inventory Improve Brother SNMP printer inventory (ifType) Jan 25, 2025
It's the field that determines the interface name on GLPI server
Copy link
Member

@g-bougard g-bougard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eduardomozart

I'm essentially okay with the PR.

Bellow you'll see essentially advice. B the "defined()" checks here are essentials.

Also can you attach another walk this time with the right format using the command described here: https://glpi-agent.readthedocs.io/en/nightly/bug-reporting.html#snmpwalk-output

Thank you

lib/GLPI/Agent/SNMP/MibSupport/BrotherNetConfig.pm Outdated Show resolved Hide resolved
lib/GLPI/Agent/SNMP/MibSupport/BrotherNetConfig.pm Outdated Show resolved Hide resolved
lib/GLPI/Agent/SNMP/MibSupport/BrotherNetConfig.pm Outdated Show resolved Hide resolved
lib/GLPI/Agent/SNMP/MibSupport/BrotherNetConfig.pm Outdated Show resolved Hide resolved
lib/GLPI/Agent/SNMP/MibSupport/BrotherNetConfig.pm Outdated Show resolved Hide resolved
eduardomozart and others added 5 commits January 26, 2025 09:11
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
@eduardomozart
Copy link
Contributor Author

Hello @g-bougard, I've updated this PR with your suggestions, tested it and it's working as expected. Also updated the snmpwalk file.

Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
@eduardomozart
Copy link
Contributor Author

Helo @g-bougard, tested your commit and it's working as expected.

@g-bougard g-bougard merged commit ba16c12 into glpi-project:develop Jan 31, 2025
16 checks passed
@g-bougard
Copy link
Member

Thank you for your contribution @eduardomozart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants