Module: check_mk
Branch: master
Commit: 2df021a0efeb011b7c2490235461babd5d39ceb6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2df021a0efeb01…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Dec 20 12:35:20 2018 +0100
EC: Minor refactoring
Having the non-EOF-case first when reading data from a pipe is more readable.
Change-Id: Ia173ab58a412bed6a4660998f7a3979d19c8e125
---
cmk/ec/main.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index a4372d0..4e10814 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -1002,17 +1002,7 @@ class EventServer(ECServerThread):
if pipe in readable:
try:
data = os.read(pipe, 4096)
- if len(data) == 0: # END OF FILE!
- os.close(pipe)
- pipe = self.open_pipe()
- listen_list[0] = pipe
- # Pending fragments from previos reads that are not terminated
- # by a \n are ignored.
- if pipe_fragment:
- self._logger.warning(
- "Ignoring incomplete message '%s' from pipe" % pipe_fragment)
- pipe_fragment = ""
- else:
+ if data:
# Prepend previous beginning of message to read data
data = pipe_fragment + data
pipe_fragment = ""
@@ -1026,6 +1016,16 @@ class EventServer(ECServerThread):
pipe_fragment = data # keep beginning of message, wait for \n
else:
self.process_raw_lines(data)
+ else: # EOF
+ os.close(pipe)
+ pipe = self.open_pipe()
+ listen_list[0] = pipe
+ # Pending fragments from previos reads that are not terminated
+ # by a \n are ignored.
+ if pipe_fragment:
+ self._logger.warning(
+ "Ignoring incomplete message '%s' from pipe" % pipe_fragment)
+ pipe_fragment = ""
except Exception:
pass
Module: check_mk
Branch: master
Commit: ebd453b7b1c2d6fdd4dff47b9e56f592f9cf1df6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebd453b7b1c2d6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Dec 20 09:36:14 2018 +0100
agent_aws: Added regions to help text
Change-Id: I6d7effa44f9235c71ea53932c474e082a971639e
---
agents/special/agent_aws | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/agents/special/agent_aws b/agents/special/agent_aws
index 4afda0c..648958d 100755
--- a/agents/special/agent_aws
+++ b/agents/special/agent_aws
@@ -960,13 +960,35 @@ class AWSSections(object):
def parse_arguments(argv):
- parser = argparse.ArgumentParser(description=__doc__)
+ parser = argparse.ArgumentParser(
+ description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument("--debug", action="store_true", help="Raise Python exceptions.")
parser.add_argument(
"--aws-access-key-id", required=True, help="The access key for your AWS account.")
parser.add_argument(
"--aws-secret-access-key", required=True, help="The secret key for your AWS account.")
- parser.add_argument("--region", required=True, help="The region to use.")
+ parser.add_argument(
+ "--region",
+ required=True,
+ help="""The region to use:
+ap-south-1 Asia Pacific (Mumbai)
+ap-northeast-3 Asia Pacific (Osaka-Local)
+ap-northeast-2 Asia Pacific (Seoul)
+ap-southeast-1 Asia Pacific (Singapore)
+ap-southeast-2 Asia Pacific (Sydney)
+ap-northeast-1 Asia Pacific (Tokyo)
+ca-central-1 Canada (Central)
+cn-north-1 China (Beijing)
+cn-northwest-1 China (Ningxia)
+eu-central-1 EU (Frankfurt)
+eu-west-1 EU (Ireland)
+eu-west-2 EU (London)
+eu-west-3 EU (Paris)
+sa-east-1 South America (Sao Paulo)
+us-east-2 US East (Ohio)
+us-east-1 US East (N. Virginia)
+us-west-1 US West (N. California)
+us-west-2 US West (Oregon)""")
parser.add_argument(
"--no-cache", action="store_true", help="Execute all sections, do not rely on cached data.")
parser.add_argument("hostname")
branch in Windows.
Message-ID: <5c1b5f10.AKckFMlz1Q+7MnDJ%sk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 38f6e99ce7cfeeeb5fdfc0fe427cafb8981c04bd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38f6e99ce7cfee…
Author: Sergey Kipnis <sk(a)mathias-kettner.de>
Date: Wed Dec 19 16:55:04 2018 +0100
[CMK-1454] - script to clean WMI "root/OpenHardwareMonitor" branch in Windows.
- in some cases this branch which used to create the section openhardwaremonitor" may become not readable(not accessible)
- the script stops agent and openhardwaremoniotr, deletes branch and restarts agent
Change-Id: I825df5e87179aa5e9099ef6a2c76311cf05d4ab5
---
doc/treasures/windows/.gitignore | 3 ++-
.../windows/openhardwaremonitor-clean.cmd | 23 ++++++++++++++++++++++
doc/treasures/windows/readme.txt | 8 +++++++-
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/doc/treasures/windows/.gitignore b/doc/treasures/windows/.gitignore
index 27485e2..797128b 100644
--- a/doc/treasures/windows/.gitignore
+++ b/doc/treasures/windows/.gitignore
@@ -1 +1,2 @@
-!*.exe
\ No newline at end of file
+!*.exe
+!*.cmd
\ No newline at end of file
diff --git a/doc/treasures/windows/openhardwaremonitor-clean.cmd b/doc/treasures/windows/openhardwaremonitor-clean.cmd
new file mode 100644
index 0000000..855fafe
--- /dev/null
+++ b/doc/treasures/windows/openhardwaremonitor-clean.cmd
@@ -0,0 +1,23 @@
+@echo off
+rem **************************************************************************************
+rem This small script is used to solve problems with OpenHardwareMonitor section
+rem "Administrative Rights" are required
+rem **************************************************************************************
+rem 1. If openhardwaremonitor section is absent, you may try this solution.
+rem 2. The script is relative safe: stops OHM WMI provider and clean WMI data.
+rem 3. As additional check you may also try in powershell command
+rem Get-WmiObject -Namespace "root\OpenHardwareMonitor" -Class Sensor -Impersonation 3
+rem start powershell.exe, copy paste string above and hit Enter.
+rem If output is absent or command is hanging up, then you should try this script
+rem **************************************************************************************
+rem Do not forget: Your Agent must be configured to provide OpenHardwareMoniotr section
+rem **************************************************************************************
+net session 2> nul
+if %errorlevel% NEQ 0 powershell Write-Host "Administrative Rights are required to run this Script" -Foreground Red && exit /B 1
+powershell Write-Host "Stopping Windows Agent and OpenHardwareMonitor..." -Foreground Cyan
+net stop check_mk_agent
+taskkill.exe /F /IM OpenHardwareMonitorCLI.exe
+powershell Write-Host "Cleaning WMI..." -Foreground Cyan
+powershell.exe -command "Get-WmiObject -query \"Select * From __Namespace Where Name='OpenHardwareMonitor'\" -Namespace \"root\" | Remove-WmiObject"
+powershell Write-Host "Starting Windows Agent again..." -Foreground Cyan
+net start check_mk_agent
diff --git a/doc/treasures/windows/readme.txt b/doc/treasures/windows/readme.txt
index 86822bd..a059012 100644
--- a/doc/treasures/windows/readme.txt
+++ b/doc/treasures/windows/readme.txt
@@ -2,7 +2,7 @@ Assorted Windows Utilities
1. perf_reader.exe
Synopsis:
- Prevent Handle Leaks on some ( usually old ) Windows OS
+ Prevents Handle Leaks on some ( usually old ) Windows OS
Usage:
1. Create in check_mk folder subfolder "utils". For example:
mkdir "c:\Program Files (x86)\check_mk\utils"
@@ -11,3 +11,9 @@ Usage:
3. Optionally you may test functionality:
goto folder "check_mk" and run check_mk_agent perfread
Note: you may need administrative privileges.
+
+2. openhardwaremonitor-clean.cmd
+Synopsis:
+ Solves problems with OpenHardwareMonitor section.
+Usage:
+ Run the script from Windows command line as Administrator