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

device: Improved hardware detection for Xerox (case issue) #5831

Merged
merged 3 commits into from Feb 8, 2017
Merged

device: Improved hardware detection for Xerox (case issue) #5831

merged 3 commits into from Feb 8, 2017

Conversation

rockyluke
Copy link
Contributor

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?

Simply DES vs. Des.

@LibreNMS-CI
Copy link

Auto-Deploy finished, Test PR at http://5831.ci.librenms.org or https://5831.ci.librenms.org

@rockyluke rockyluke changed the title Better hardware detection for Xerox device: Better hardware detection for Xerox (case issue) Feb 8, 2017
@rockyluke rockyluke changed the title device: Better hardware detection for Xerox (case issue) device: Improved hardware detection for Xerox (case issue) Feb 8, 2017
@@ -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));
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, easier and cleaner !

@LibreNMS-CI
Copy link

Auto-Deploy finished, Test PR at http://5831.ci.librenms.org or https://5831.ci.librenms.org

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

@laf laf merged commit 8559137 into librenms:master Feb 8, 2017
@rockyluke rockyluke deleted the xerox-des branch February 9, 2017 14:23
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants