Module: check_mk
Branch: master
Commit: 95924dc8ec02f1ae3cebe9d0c3fa30025a06c504
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=95924dc8ec02f1…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Nov 23 12:10:21 2017 +0100
5550 FIX mk_oracle.ps1: Fixed exceptions because of useless backslashes
There has been a bug introduced as part of an feature enhancement which
caused an exception of the plugin and prevented the execution. This Bug has
been introduced in June 16th and is solved now.
Change-Id: I77e7bc779b5596b6fb47c23b3afa84ff766c54b7
---
.werks/5550 | 12 ++++++++++++
agents/windows/plugins/mk_oracle.ps1 | 10 +++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.werks/5550 b/.werks/5550
new file mode 100644
index 0000000..fd15a0b
--- /dev/null
+++ b/.werks/5550
@@ -0,0 +1,12 @@
+Title: mk_oracle.ps1: Fixed exceptions because of useless backslashes
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1511435209
+Class: fix
+
+There has been a bug introduced as part of a feature enhancement which
+caused an exception of the plugin and prevented the execution. This bug has
+been introduced in June 16th and is solved now.
diff --git a/agents/windows/plugins/mk_oracle.ps1 b/agents/windows/plugins/mk_oracle.ps1
index 078e643..f0558ae 100644
--- a/agents/windows/plugins/mk_oracle.ps1
+++ b/agents/windows/plugins/mk_oracle.ps1
@@ -1108,7 +1108,7 @@ select upper(i.instance_name)
|| '|' || logswitches
from v$instance i ,
(select count(1) logswitches
- from v\$loghist h , v\$instance i
+ from v$loghist h , v$instance i
where h.first_time > sysdate - 1/24
and h.thread# = i.instance_number)
;
@@ -1145,15 +1145,15 @@ Function sql_locks {
|| '|' || bs.process
|| '|' || bs.osuser
|| '|' || bs.username
- from v\$session b
- join v\$instance i on 1=1
- join gv\$session bs on bs.inst_id = b.BLOCKING_INSTANCE
+ from v$session b
+ join v$instance i on 1=1
+ join gv$session bs on bs.inst_id = b.BLOCKING_INSTANCE
and bs.sid = b.BLOCKING_SESSION
where b.BLOCKING_SESSION is not null
;
select upper(i.instance_name)
|| '|||||||||||||||||'
- from v\$instance i
+ from v$instance i
;
'@
echo $query_locks
Module: check_mk
Branch: master
Commit: 94a2f52ca62d78d870e88249606a3fe30064e0ea
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94a2f52ca62d78…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Dec 22 10:16:49 2017 +0100
Reformat docstrings
Change-Id: I115dcd452e6b810a2a3e27b47ec149b99d8d9c61
---
tests/checks/checktestlib.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/checks/checktestlib.py b/tests/checks/checktestlib.py
index c8a723d..2d55171 100644
--- a/tests/checks/checktestlib.py
+++ b/tests/checks/checktestlib.py
@@ -29,10 +29,12 @@ class PerfValue(object):
class BasicCheckResult(object):
- """A basic check result
+ """
+ A basic check result
This class models a basic check result (status, infotext, perfdata) and provides
- facilities to match it against conditions, such as 'Status is...' or 'Infotext contains...'
+ facilities to match it against conditions, such as 'Status is...' or
+ 'Infotext contains...'
"""
def __init__(self, status, infotext, perfdata=None):
@@ -55,13 +57,17 @@ class BasicCheckResult(object):
class CheckResult(object):
- """A check result potentially consisting of multiple subresults, as returned by yield-style checks"""
+ """
+ A check result potentially consisting of multiple subresults,
+ as returned by yield-style checks
+ """
def __init__(self, result):
- """Initializes a list of subresults using BasicCheckResult.
+ """
+ Initializes a list of subresults using BasicCheckResult.
- If the result is already a plain check result in its tuple representation, we initialize
- a list of length 1.
+ If the result is already a plain check result in its tuple representation,
+ we initialize a list of length 1.
"""
if type(result) == types.GeneratorType:
Module: check_mk
Branch: master
Commit: cd7c7ab514339e760577fe11b4399ca870dc2465
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cd7c7ab514339e…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Dec 22 08:07:55 2017 +0100
Fix typo in comments
Change-Id: I66b6d375345a96b6489150b9a0c765945272d1f9
---
agents/windows/it/remote.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/agents/windows/it/remote.py b/agents/windows/it/remote.py
index b9e7de2..6352078 100644
--- a/agents/windows/it/remote.py
+++ b/agents/windows/it/remote.py
@@ -8,9 +8,9 @@ import subprocess
import sys
import telnetlib
-# To use a another host for running the tests, replace this IP address.
+# To use another host for running the tests, replace this IP address.
remote_ip = '10.1.2.30'
-# To use a another user account for running the tests, replace this username.
+# To use another user account for running the tests, replace this username.
remoteuser = 'NetworkAdministrator'
remotedir = os.path.join(os.sep, 'Users', remoteuser, 'Tests')
sshopts = "-o StrictHostKeyChecking=no"
Module: check_mk
Branch: master
Commit: 2d62242e4c6f4d03972b34ec4193b5d7f711e186
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2d62242e4c6f4d…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Dec 21 16:24:49 2017 +0100
5485 FIX alcatel_power: improved detection of power supplies on newer devices
Previously, the power supplies were detected based on the module type id.
Now the power supplies are detected through the more specifig power supply
type. The module type is only used as a fallback when the power supply
type is not available.
Change-Id: I75734bac103180ab264e91a0e65def17f85d4b66
---
.werks/5485 | 13 +++++++++++++
checks/alcatel_power | 21 +++++++++++++--------
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/.werks/5485 b/.werks/5485
new file mode 100644
index 0000000..dc51167
--- /dev/null
+++ b/.werks/5485
@@ -0,0 +1,13 @@
+Title: alcatel_power: improved detection of power supplies on newer devices
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1513869431
+Class: fix
+
+Previously, the power supplies were detected based on the module type id.
+Now the power supplies are detected through the more specifig power supply
+type. The module type is only used as a fallback when the power supply
+type is not available.
diff --git a/checks/alcatel_power b/checks/alcatel_power
index 3bd7d39..486e26f 100644
--- a/checks/alcatel_power
+++ b/checks/alcatel_power
@@ -26,16 +26,20 @@
def inventory_alcatel_power(info):
for line in info:
- if line[2] in ['0x35000001', '0x45000002', '0x45000004', '0x45000008', '0x45000009']:
- yield line[0], None
+ oid_end, _, device_type, power_type = line
+ if (power_type and power_type != '0' or
+ device_type in ['0x35000001', '0x45000002', '0x45000004', '0x45000008', '0x45000009']):
+ yield oid_end, None
def check_alcatel_power(item, _no_params, info):
for line in info:
- if item == line[0]:
- if line[2] not in ['0x35000001', '0x45000004', '0x45000002', '0x45000008', '0x45000009']:
+ oid_end, status, device_type, power_type = line
+ if item == oid_end:
+ if (power_type and power_type == '0' or
+ device_type not in ['0x35000001', '0x45000004', '0x45000002', '0x45000008', '0x45000009']):
return 3, "No Power supply connected to this port"
- if int(line[1]) != 1:
- return 2, "Supply in error condition (%s)" % line[1]
+ if status != '1':
+ return 2, "Supply in error condition (%s)" % status
return 0, "Supply status OK"
return 3, "Supply not found"
@@ -46,8 +50,9 @@ check_info["alcatel_power"] = {
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6486.800"),
"snmp_info" : (".1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1",
[OID_END,
- 2, # Error Status
- 5 # Device Type (0x35000001 == Power Supply)
+ 2, # Error Status
+ 5, # Device Type (0x35000001 == Power Supply)
+ 36, # chasEntPhysPowerType: 0 no power supply, 1 ac, 2 dc (not available on old devices)
]),
}
Module: check_mk
Branch: master
Commit: 0b32949f1c12412ce2f8f28e0f24f1dfe639d9c3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0b32949f1c1241…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Oct 20 12:16:54 2017 +0200
Windows agent: add integration tests
Add pytest-based integration tests. The purpose is to offer basic
regression tests to ensure that basic functionality remains intact
across refactorings etc.
The test setup requires a local Linux machine to run the tests on. The
user at the Linux machine must have ssh RSA key pair specifically
generated for this purpose as ~/.ssh/id_rsa_windows_test[.pub]. A
dedicated Windows server must be available for remote access over SSH
with the public key in its authorized keys.
Each pytest test case will be initiated on local Linux machine but
switch over SSH to the remote Windows server and run the actual test
case there. Per-session setup and teardown, e.g. copying files over SSH
is done with the help of per-session pytest fixtures defined in
conftest.py.
The tests cover most of the sections in the output of the Windows
agent. Currently excluded are the sections MS Exchange and Skype as
these require the installations of these commercial software products.
The output is verified against expected patterns and is likely to find
the vast majority of missing or malformatted output. Substantial errors
resulting from broken functionality but that are formatted and output
correctly are likely to go unnoticed.
The sections 'plugins' and 'local' are tested with the plugins
netstat_an.bat and wmic_if.bat. The target is to ensure the correct
functionality of the plugin execution framework of the Windows agent.
The tests can be later extended to test the execution of other plugins,
if necessary.
Besides the output of agent sections during normal execution, the start
parameters of the Windows agent are tested. These tests would interfere
with possibly existing Check_MK_Agent service on the system. This is why
a possibly existing installation is removed during test setup.
Inter-process synchronized access to lock file is used in order to
prevent simultaneous execution of tests in several processes.
PENDING CHANGES:
The build target integrationtest will be committed separately later when
the build server(s) support the test-specific SSH keys. Before that, a
premature commit of the build changes would break the build.
Change-Id: I26e5543924e07acff56be16f9fe6724a8f78358a
---
agents/windows/it/conftest.py | 77 +++++++
agents/windows/it/lock.py | 50 +++++
agents/windows/it/remote.py | 186 ++++++++++++++++
agents/windows/it/test_agent_start_parameters.py | 242 +++++++++++++++++++++
agents/windows/it/test_section_check_mk.py | 120 ++++++++++
agents/windows/it/test_section_df.py | 32 +++
agents/windows/it/test_section_dotnet_clrmemory.py | 44 ++++
agents/windows/it/test_section_eventlog.py | 194 +++++++++++++++++
agents/windows/it/test_section_fileinfo.py | 76 +++++++
agents/windows/it/test_section_logfiles.py | 202 +++++++++++++++++
agents/windows/it/test_section_mem.py | 35 +++
agents/windows/it/test_section_mrpe.py | 64 ++++++
.../windows/it/test_section_openhardwaremonitor.py | 95 ++++++++
agents/windows/it/test_section_plugin_group.py | 120 ++++++++++
agents/windows/it/test_section_ps.py | 42 ++++
agents/windows/it/test_section_services.py | 33 +++
agents/windows/it/test_section_spool.py | 61 ++++++
agents/windows/it/test_section_systemtime.py | 26 +++
agents/windows/it/test_section_uptime.py | 25 +++
agents/windows/it/test_section_winperf.py | 31 +++
agents/windows/it/test_section_wmi_cpuload.py | 64 ++++++
agents/windows/it/test_section_wmi_webservices.py | 83 +++++++
22 files changed, 1902 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=0b32949f1c…