Module: check_mk
Branch: master
Commit: 727a15bc4793f5fa8857a7e389604eb93079e6f1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=727a15bc4793f5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue May 26 14:33:56 2015 +0200
Tescommit
---
agents/windows/check_mk_agent.cc | 1 -
1 file changed, 1 deletion(-)
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index ba02dcb..5c15956 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -22,7 +22,6 @@
// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA.
-
// Looking for documentation on Win32-API? Here are some of the
// documents that I used:
Module: check_mk
Branch: master
Commit: 5c34c0bbeff04bb939b087a01448a6d6de7c8735
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c34c0bbeff04b…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 26 14:11:30 2015 +0200
#2278 FIX printer_supply: now able to toggle the point of view for used and remaining material
There is a <i>Upturn toner levels</i> option available which allows you
to switch the point of view from the remaining- to the used-perspective.
This was useful, because there are waste toner boxes which count in the
different direction.
In case of waste toner boxes the upturn feature was hardcoded on.
However, depending on the manufacturer the count direction differs...
With this change the upturn option now toggles the direction every time,
so it doesn't matter if the component is a cartridge or a waste toner box.
After updating to this version, you should check the toner levels and
set the <i>Upturn toner levels</i> accordingly.
---
.werks/2278 | 21 +++++++++++++++++++++
ChangeLog | 2 ++
checks/printer_supply | 8 +++++++-
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/.werks/2278 b/.werks/2278
new file mode 100644
index 0000000..2ce7c2d
--- /dev/null
+++ b/.werks/2278
@@ -0,0 +1,21 @@
+Title: printer_supply: now able to toggle the point of view for used and remaining material
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+State: unknown
+Version: 1.2.7i1
+Date: 1432641270
+
+There is a <i>Upturn toner levels</i> option available which allows you
+to switch the point of view from the remaining- to the used-perspective.
+This was useful, because there are waste toner boxes which count in the
+different direction.
+
+In case of waste toner boxes the upturn feature was hardcoded on.
+However, depending on the manufacturer the count direction differs...
+With this change the upturn option now toggles the direction every time,
+so it doesn't matter if the component is a cartridge or a waste toner box.
+
+After updating to this version, you should check the toner levels and
+set the <i>Upturn toner levels</i> accordingly.
diff --git a/ChangeLog b/ChangeLog
index bb685eb..767614f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -383,6 +383,8 @@
* 2268 FIX: db2_tablespaces: no longer throws exception in checks when complete db2 instance vanishes
* 2272 FIX: mrpe: made UNKNOWN message more clear in case of an invalid state char
* 2255 FIX: checkpoint_*: Fixed exception in scan function when sysDescr has less than 2 spaces...
+ * 2278 FIX: printer_supply: now able to toggle the point of view for used and remaining material...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/printer_supply b/checks/printer_supply
index 488b86b..ed206a5 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -140,9 +140,15 @@ def check_printer_supply(item, params, info):
return (0, "current level is %d" % current, [("pages", current)])
leftperc = 100.0 * float(current) / maxlevel
- if upturn or unit_type == 4:
+
+ if unit_type == 4:
+ leftperc = 100 - leftperc
+ # Some printers handle the used / remaining material differently
+ # With the upturn option we can toggle the point of view (again)
+ if upturn:
leftperc = 100 - leftperc
+
infotext = "%.0f%% (levels at %.0f%% / %.0f%%)" % (leftperc, warn, crit)
if leftperc <= crit:
return (2, infotext, perfdata)