Module: check_mk
Branch: master
Commit: a68a18cd44e5dbb59680264b9dae1ef5405bc411
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a68a18cd44e5db…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 17 12:09:36 2013 +0100
FIX win_printers: Fixed creation of duplicate services
Longer printer names were stripped and could result in duplicate services
found. This patch extends the terminal width of the agent plugin and prevents
stripping of chars.
Thanks to Andreas Döhler for submitting the patch.
---
.werks/381 | 14 ++++++++++++++
ChangeLog | 1 +
agents/windows/plugins/win_printers.ps1 | 13 +++++++++++++
3 files changed, 28 insertions(+)
diff --git a/.werks/381 b/.werks/381
new file mode 100644
index 0000000..80f4d66
--- /dev/null
+++ b/.werks/381
@@ -0,0 +1,14 @@
+Title: win_printers: Fixed creation of duplicate services
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387278488
+Targetversion: future
+
+Longer printer names were stripped and could result in duplicate services
+found. This patch extends the terminal width of the agent plugin and prevents
+stripping of chars.
+
+Thanks to Andreas Döhler for submitting the patch.
diff --git a/ChangeLog b/ChangeLog
index 1e3b68a..06fc932 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,7 @@
* 0378 FIX: agent_vsphere.pysphere: Trying to deal with permissions only on some
guests/hosts
* 0245 FIX: Inline SNMP now longer throws an exception when using SNMPv3
credentials...
* 0380 FIX: jolokia_metrics.mem: PNP-Template now handles non existant max values...
+ * 0381 FIX: win_printers: Fixed creation of duplicate services...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/windows/plugins/win_printers.ps1
b/agents/windows/plugins/win_printers.ps1
index dd35b63..f5489e7 100644
--- a/agents/windows/plugins/win_printers.ps1
+++ b/agents/windows/plugins/win_printers.ps1
@@ -4,6 +4,19 @@
#
####
+###
+##
http://blogs.technet.com/b/heyscriptingguy/archive/2006/12/04/how-can-i-exp…
+
+$pshost = get-host
+$pswindow = $pshost.ui.rawui
+
+$newsize = $pswindow.buffersize
+$newsize.height = 300
+$newsize.width = 150
+$pswindow.buffersize = $newsize
+
+###
+
Write-Host NoNewLine "<<<win_printers>>>"
$Data_Set1 = Get-WMIObject Win32_PerfFormattedData_Spooler_PrintQueue | Select Name,
@{Expression={$_.jobs};Label="CurrentJobs"}
$Data_Set2 = Get-WmiObject win32_printer | select name, printerstatus,
detectederrorstate