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

Merged
merged 3 commits into from Feb 8, 2017

Conversation

Projects
None yet
4 participants
@rockyluke
Contributor

rockyluke commented Feb 8, 2017

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.

rockyluke added some commits Feb 8, 2017

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

@rockyluke rockyluke changed the title from Better hardware detection for Xerox to device: Better hardware detection for Xerox (case issue) Feb 8, 2017

@rockyluke rockyluke changed the title from device: Better hardware detection for Xerox (case issue) to device: Improved hardware detection for Xerox (case issue) Feb 8, 2017

includes/polling/os/xerox.inc.php
@@ -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));

This comment has been minimized.

@laf

laf Feb 8, 2017

Member

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?

@laf

laf Feb 8, 2017

Member

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?

This comment has been minimized.

@rockyluke

rockyluke Feb 8, 2017

Contributor

Yes, easier and cleaner !

@rockyluke

rockyluke Feb 8, 2017

Contributor

Yes, easier and cleaner !

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Feb 8, 2017

The inspection completed: No new issues

The inspection completed: No new issues

@laf laf merged commit 8559137 into librenms:master Feb 8, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rockyluke rockyluke deleted the vp-noc:xerox-des branch Feb 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment