ricoh devices returning garbage as toner level #4180

Merged
merged 3 commits into from Aug 24, 2016

Projects

None yet

4 participants

@crcro
Contributor
crcro commented Aug 23, 2016

issue #4177

@laf laf commented on an outdated diff Aug 23, 2016
includes/discovery/toner.inc.php
@@ -29,7 +29,16 @@
if ($descr != '') {
$current = snmp_get($device, $toner_oid, '-Oqv');
$capacity = snmp_get($device, $capacity_oid, '-Oqv');
- $current = ($current / $capacity * 100);
+ //fix for ricoh devices returning garbage
@laf
laf Aug 23, 2016 Member

Worth wrapping this in if ($os == 'richoh') { to limit it's risk for other printers.

@laf laf added the Blocker label Aug 23, 2016
crcro added some commits Aug 23, 2016
@crcro crcro ricoh devices returning garbage as toner level cfed121
@crcro crcro ricoh toner extra check
2cf3adb
@crcro crcro more ricoh rules
9ac25b4
@scrutinizer-notifier

The inspection completed: No new issues

@laf laf commented on the diff Aug 24, 2016
includes/discovery/toner.inc.php
if ($descr != '') {
$current = snmp_get($device, $toner_oid, '-Oqv');
- $capacity = snmp_get($device, $capacity_oid, '-Oqv');
- $current = ($current / $capacity * 100);
+
+ //ricoh private mibs returns values as percent, no capacity is disclosed as it is not needed
+ if ($os == 'ricoh') {
+ $capacity = 100;
+ } else {
+ $capacity = snmp_get($device, $capacity_oid, '-Oqv');
+ }
+
+ //fix for ricoh devices returning garbage and devices returning percentage
+ if ($os == 'ricoh') {
@laf
laf Aug 24, 2016 Member

Do you need this now you have the actual correct OID for current?

@crcro
crcro Aug 24, 2016 edited Contributor

yes because they still have models that returns only -3 and -100 and they also don't return the capacity (they return the percentage available not measurement units)

@laf laf added Discovery and removed Blocker labels Aug 24, 2016
@laf laf merged commit 6b2ac09 into librenms:master Aug 24, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Tatermen Tatermen added a commit to Tatermen/librenms that referenced this pull request Aug 26, 2016
@crcro @Tatermen crcro + Tatermen ricoh devices returning garbage as toner level (#4180)
* ricoh devices returning garbage as toner level

* ricoh toner extra check

* more ricoh rules
e995097
@laf laf added a commit that referenced this pull request Aug 26, 2016
@Tatermen @laf Tatermen + laf Freeswitch support (#4203)
* Added support for freeswitch via unix_agent

* Fixed display of graphs on apps overview

* Removed tab indents

* Fixed not sending port_descr_type (#4188)

* Removed / Updated version info to just be LibreNMS (#4193)

* Remove requirement for ['enable_printers'] (#4192)

* ricoh devices returning garbage as toner level (#4180)

* ricoh devices returning garbage as toner level

* ricoh toner extra check

* more ricoh rules

* Fix remote rrdtool_check_rrd_exists() calls (#4196)

It was comparing with the full name when rrdcached only printed out the relative name.
Thanks mikmak on irc for lots of troubleshooting.

* check for no motd line (#4200)

Fixes #4199

* Only push the toc down, not the content
the toc is on top when the header switches to two lines, so we only need to push that down.

* IRC bot - detect lost communication

Force reconnect if no data received from server for config['irc_conn_timeout'] seconds (that may happen when network/VPN goes down - in such case IRC bot won't get immediately notification that connection was lost, at least till it tries to send anything).

* Update irc.php

* Update irc.php

* Update irc.php

* Update irc.php

* fix ifName randomly defined, breaking influxdb updates (#4202)

* IRC bot - allow to disable ssl check

In PHP 5.6.x stream wrappers verify peer certificates and host names by default when using SSL. That fix allows to turn off that verification with config option $config['irc_disable_ssl_check'] = true; 
It is useful when you want to use self generated certificate for your own IRC server.

* Update irc.php

* More more docs (#4197)

* Updated docs + some small code changes

* Added validating code doc for developers

* Doc updates

* Updates and improvements

* Add ntpd to the list of agentapps (#4194)

* Fix deprecated constructors
This small change should't prevent easy updates to libraries and fixes the lint check on php7

* Don't allow php7 failures anymore

* Fix defunct process issues: create Proc class (#4210)

* Proc class
Encapsulate processes in a class, when they go out of scope, we can use the __destruct() process to make sure the process terminates.

* Fix rrdtool_last checks failing

* Don't close rrdtool in rrd_graph
Try to start rrdtool process if they haven't been started yet
Remove some extra debug output

* phpdocs added
several cleanups
should still be functioning the same
Only open one  rrdtool process for graph.php

* include common.php in definitions.inc.php (#4198)

definitions.inc.php makes a call to dbFetchRow, which uses c_echo()
It is safe to include common.php here as it only has function definitions.

* Use pre-commit.php in for travis-ci tests (#4212)
19f231d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment