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
device: Improved hardware detection for Xerox (case issue) #5831
Conversation
Auto-Deploy finished, Test PR at http://5831.ci.librenms.org or https://5831.ci.librenms.org |
includes/polling/os/xerox.inc.php
Outdated
@@ -2,14 +2,21 @@ | |||
|
|||
// ...253.8.51.1.2.1.20.1 = STRING: "MFG:Xerox;CMD:Adobe PostScript 3,PCL;MDL:Phaser 4510N;CLS:Printer;DES:Xerox Phaser 4510 Laser Printer, PostScript 3, Letter/A4 Size" | |||
// ...253.8.51.1.2.1.20.1 = STRING: "MFG:Xerox;CMD:Adobe PostScript 3,PCL;MDL:ColorQube 8880DN;CLS:Printer;DES:Xerox ColorQube 8580 & 8880, Color Printer,PostScript 3,Letter/A4 Size " | |||
// ...253.8.51.1.2.1.20.1 = STRING: "MFG:Xerox; CMD:PCL, PJL, POSTSCRIPT; MDL:WorkCentre 7535; CLS:Printer; Des:Xerox WorkCentre 7535" | |||
$xinfo = explode(';', trim(snmp_get($device, '1.3.6.1.4.1.253.8.51.1.2.1.20.1', '-OQv', '', ''), '" ')); | |||
|
|||
foreach ($xinfo as $xi) { | |||
list($key,$value) = explode(':', trim($xi)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be easier to just run http://uk1.php.net/manual/en/function.strtoupper.php on $key
before it's used in $xerox
then you don't need to worry about case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, easier and cleaner !
Auto-Deploy finished, Test PR at http://5831.ci.librenms.org or https://5831.ci.librenms.org |
The inspection completed: No new issues |
DO NOT DELETE THIS TEXT
Please note
Simply DES vs. Des.