Module: check_mk
Branch: master
Commit: bb0c68a8ff28c331579d4c1a16db8150d28e67ad
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb0c68a8ff28c3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 29 11:01:58 2016 +0100
4078 FIX Fixed handling of hosts with non resolvable IP addresses during runtime
Hosts which only have a hostname configured that IP address is resolved during
configuration creation. When a host could not be resolved it is added to the
monitoring with the 0.0.0.0 or :: address.
That lead to some checks monitoring the local host accidentally.
---
.werks/4078 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 3 +++
3 files changed, 17 insertions(+)
diff --git a/.werks/4078 b/.werks/4078
new file mode 100644
index 0000000..0eca23c
--- /dev/null
+++ b/.werks/4078
@@ -0,0 +1,13 @@
+Title: Fixed handling of hosts with non resolvable IP addresses during runtime
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480413611
+Class: fix
+
+Hosts which only have a hostname configured that IP address is resolved during
+configuration creation. When a host could not be resolved it is added to the
+monitoring with the 0.0.0.0 or :: address.
+
+That lead to some checks monitoring the local host accidentally.
diff --git a/ChangeLog b/ChangeLog
index 15b16c6..a38cc2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.4.0i3:
Core & Setup:
* 3978 FIX: mkbackup: Fixed backup to some CIFS shares ([Errno 13] Permission denied) '...')...
+ * 4078 FIX: Fixed handling of hosts with non resolvable IP addresses during runtime...
Checks & Agents:
* 3988 Windows agent: new global option disabled_sections...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 3f58475..5845646 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -679,6 +679,9 @@ def write_cache_file(relpath, output):
# In that case it will be looked up if needed. Also caching will
# be handled here
def get_agent_info(hostname, ipaddress, max_cache_age):
+ if ipaddress in [ "0.0.0.0", "::" ]:
+ raise MKAgentError("Failed to lookup IP address and no explicit IP address configured")
+
output = read_cache_file(hostname, max_cache_age)
if not output:
# Try to contact every host only once
Module: check_mk
Branch: master
Commit: ebaf92efd9fe11ddb0caa4b00281f608d2d3893d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebaf92efd9fe11…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Tue Nov 29 09:15:55 2016 +0100
4116 mk_oracle.ps1: added Oracle wallet support to Windows plugin
The plugin for windows could be used with the Oracle wallet. The support is
limitted to all Instances except ASM. This function is only for
administrators who really knows how to use the wallet.
You have to add an entry with the name of the instance. Please check the
connection with SQLPlus before trying to use the plugin.
The plugin use the following connection:
sqlplus /@<ORACLE_SID>
You have to add a credential to the wallet with the ORACLE_SID as name for
the entry:
Example:
mkstore -wrl <Wallet Directory> createCredential „<ORACLE_SID>" <Username> <Password>
The wallet is only used, when username is set to '/'. Password,
hostname and listener-port is ignored, because the tnsnames.ora is used.
Please read the doumentation from Oracle for using the wallet. The
sqlnet.ora must be configured for your environment and the wallet must be
created before adding some entries. You could use TNS_ADMIN in
mk_oracle_cfg.ps1 for pointing to the sqlnet configuration for the plugin.
---
.werks/4116 | 29 +++++++++++++++++++++++++++++
ChangeLog | 1 +
agents/windows/plugins/mk_oracle.ps1 | 23 +++++++++++++++++------
3 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/.werks/4116 b/.werks/4116
new file mode 100644
index 0000000..915a0cf
--- /dev/null
+++ b/.werks/4116
@@ -0,0 +1,29 @@
+Title: mk_oracle.ps1: added Oracle wallet support to Windows plugin
+Level: 2
+Component: checks
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480406962
+Class: feature
+
+The plugin for windows could be used with the Oracle wallet. The support is
+limitted to all Instances except ASM. This function is only for
+administrators who really knows how to use the wallet.
+
+You have to add an entry with the name of the instance. Please check the
+connection with SQLPlus before trying to use the plugin.
+The plugin use the following connection:
+sqlplus /@<ORACLE_SID>
+
+You have to add a credential to the wallet with the ORACLE_SID as name for
+the entry:
+Example:
+mkstore -wrl <Wallet Directory> createCredential „<ORACLE_SID>" <Username> <Password>
+
+The wallet is only used, when username is set to '/'. Password,
+hostname and listener-port is ignored, because the tnsnames.ora is used.
+
+Please read the doumentation from Oracle for using the wallet. The
+sqlnet.ora must be configured for your environment and the wallet must be
+created before adding some entries. You could use TNS_ADMIN in
+mk_oracle_cfg.ps1 for pointing to the sqlnet configuration for the plugin.
diff --git a/ChangeLog b/ChangeLog
index e6878e9..15b16c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 4094 apc_rackpdu_power: now detects all phases or banks connected to this pdu
NOTE: Please refer to the migration notes!
* 3993 Some minor performance improvements during config generation...
+ * 4116 mk_oracle.ps1: added Oracle wallet support to Windows plugin...
* 3987 FIX: Check_MK Agent Access: Windows agent reported incorrect only from value
* 3952 FIX: diskstat: fixed bug if multipath devices having an alias...
* 3939 FIX: f5_bigip_conns: readded performance data and graphs...
diff --git a/agents/windows/plugins/mk_oracle.ps1 b/agents/windows/plugins/mk_oracle.ps1
index bd212b9..0188ab1 100644
--- a/agents/windows/plugins/mk_oracle.ps1
+++ b/agents/windows/plugins/mk_oracle.ps1
@@ -123,7 +123,8 @@ Param(
)
# if debug=1 then output
if ($DEBUG -gt 0) {
- echo "DEBUG:${error_message}"
+ $MYTIME=Get-Date -Format o
+ echo "${MYTIME} DEBUG:${error_message}"
}
}
@@ -384,11 +385,17 @@ Param(
else {
$assysdbaconnect=""
}
- #$TNSALIAS="$the_host`:$the_port/$sqlsid"
$UPPER_SID=$sqlsid.toupper()
- $TNSALIAS="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$the_host)(PORT=$the_port))(CONNECT_DATA=(SID=$UPPER_SID)))"
- # we presume we can use an EZconnect
- $SQL_CONNECT="$the_user/$the_password@$TNSALIAS$assysdbaconnect"
+
+ # use oracle wallet if requested in cfg file
+ if ($the_user -like "/" ) {
+ $SQL_CONNECT="/@$UPPER_SID$assysdbaconnect"
+ }
+ else {
+ $TNSALIAS="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$the_host)(PORT=$the_port))(CONNECT_DATA=(SID=$UPPER_SID)))"
+ # we presume we can use an EZconnect
+ $SQL_CONNECT="$the_user/$the_password@$TNSALIAS$assysdbaconnect"
+ }
debug_echo "value of sql_connect in dbuser = $SQL_CONNECT"
} else {
debug_echo "DBUSER is not defined"
@@ -1269,7 +1276,7 @@ $list_inst=(get-service -Name "Oracle*Service*" -include "OracleService*", "Orac
# the following line ensures that the output of the files generated by calling
# Oracle SQLplus through Powershell are not limited to 80 character width. The
# 80 character width limit is the default
-$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (512, 50)
+$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (512, 150)
# We have to set some value for the ORACLE_SID, although here a nonsense value
# This value is used when we want to simply list all the banners
@@ -1420,6 +1427,10 @@ if ($the_count -gt 0) {
}
}
}
+ # We need an line break after last output from sections
+ # otherwise the agent adds <<<local>>> as parameter to the last line of plugin
+ echo ""
+
}
debug_echo "got to the end"