[Pkg-nagios-changes] [pkg-icinga2] 03/08: Imported Upstream version 2.2.3

Alexander Wirt formorer at debian.org
Mon Jan 12 19:43:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

formorer pushed a commit to branch ubuntu
in repository pkg-icinga2.

commit c33e9ae6a6679762ce9533b744f37145c10b973a
Author: Alexander Wirt <formorer at debian.org>
Date:   Mon Jan 12 09:16:45 2015 +0100

    Imported Upstream version 2.2.3
---
 .mailmap                                |   1 +
 ChangeLog                               |  20 ++++++
 INSTALL.md                              |  17 ++---
 doc/1-about.md                          |  20 ++++++
 doc/7-configuring-icinga-2.md           |   2 +-
 icinga2.spec                            |   5 +-
 lib/base/application.cpp                |   4 +-
 lib/base/tlsstream.cpp                  |  11 +++-
 lib/base/tlsstream.hpp                  |   2 +
 lib/cli/nodeupdateconfigcommand.cpp     | 110 +++++++++++++++++---------------
 lib/cli/nodewizardcommand.cpp           |   2 +-
 lib/db_ido_mysql/idomysqlconnection.cpp |   4 +-
 lib/db_ido_pgsql/idopgsqlconnection.cpp |   4 +-
 lib/icinga/checkable-check.cpp          |  14 ++--
 lib/icinga/checkable.cpp                |   2 +-
 lib/icinga/notification.cpp             |   9 ++-
 lib/icinga/pluginutility.cpp            |  16 ++---
 plugins/check_service.cpp               |   4 +-
 test/config/8063.conf                   |  53 +++++++++++++++
 19 files changed, 205 insertions(+), 95 deletions(-)

diff --git a/.mailmap b/.mailmap
index 140198f..a02360e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -3,3 +3,4 @@
 Gunnar Beutner <gunnar.beutner at netways.de> <icinga at net-icinga2.adm.netways.de>
 <michael.friedrich at netways.de> <michael.friedrich at gmail.com>
 <michael.friedrich at netways.de> <Michael.Friedrich at netways.de>
+<tobias at vonderkrone.info> <tobias.vonderkrone at profitbricks.com>
diff --git a/ChangeLog b/ChangeLog
index 1dd382e..4af5217 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,26 @@ Please check [doc/1-about.md].
 
 ## What's New
 
+### What's New in Version 2.2.3
+
+#### Changes
+
+* Bugfixes
+
+#### Issues
+
+* Bug #8063: Volatile checks trigger invalid notifications on OK->OK state changes
+* Bug #8125: Incorrect ticket shouldn't cause "node wizard" to terminate
+* Bug #8126: Icinga 2.2.2 doesn't build on i586 SUSE distributions
+* Bug #8143: Windows plugin check_service.exe can't find service NTDS
+* Bug #8144: Arguments without values are not used on plugin exec
+* Bug #8147: check_interval must be greater than 0 error on update-config
+* Bug #8152: DB IDO query queue limit reached on reload
+* Bug #8171: Typo in example of StatusDataWriter
+* Bug #8178: Icinga 2.2.2 segfaults on FreeBSD
+* Bug #8181: icinga2 node update config shows hex instead of human readable names
+* Bug #8182: Segfault on update-config old empty config
+
 ### What's New in Version 2.2.2
 
 #### Changes
diff --git a/INSTALL.md b/INSTALL.md
index a3dd3ba..e4fc2bc 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -76,7 +76,8 @@ Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files
     $ git log --use-mailmap | grep ^Author: | cut -f2- -d' ' | sort | uniq > AUTHORS
 
 Bump the version in icinga2.spec.
-Update the [ChangeLog](ChangeLog) and [doc/1-about.md](doc/1-about.md) files.
+Update the [ChangeLog](ChangeLog), [doc/1-about.md](doc/1-about.md) and [INSTALL.md](INSTALL.md)
+files.
 Commit these changes to the "master" branch.
 
     $ git commit -v -a -m "Release version <VERSION>"
@@ -89,11 +90,11 @@ GB:
 MF:
 
     $ git tag -u D14A1F16 -m "Version <VERSION>" v<VERSION>
-    
+
 Push the tag.
 
     $ git push --tags
-    
+
 Merge the "master" branch into the "support/2.2" branch (using --ff-only).
 
     $ git checkout support/2.2
@@ -111,12 +112,12 @@ disable the usage of `git describe`.
 
 Use `git archive` to build the release tarball:
 
-    $ VERSION=2.2.2
+    $ VERSION=2.2.3
     $ git archive --format=tar --prefix=icinga2-$VERSION/ tags/v$VERSION | gzip >icinga2-$VERSION.tar.gz
 
 Finally you should verify that the tarball only contains the files it should contain:
 
-    $ VERSION=2.2.2
+    $ VERSION=2.2.3
     $ tar ztf icinga2-$VERSION.tar.gz | less
 
 
@@ -145,12 +146,12 @@ variables are supported:
 - `ICINGA2_PLUGINDIR`: The path for the Monitoring Plugins project binaries; defaults to `/usr/lib/nagios/plugins`
 - `ICINGA2_RUNDIR`: The location of the "run" directory; defaults to `CMAKE_INSTALL_LOCALSTATEDIR/run`
 - `CMAKE_INSTALL_SYSCONFDIR`: The configuration directory; defaults to `CMAKE_INSTALL_PREFIX/etc`
-- `ICINGA2_SYSCONFIGFILE`: Where to put the config file the initscript/systemd pulls it's dirs from; 
+- `ICINGA2_SYSCONFIGFILE`: Where to put the config file the initscript/systemd pulls it's dirs from;
 defaults to `CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2`
 - `CMAKE_INSTALL_LOCALSTATEDIR`: The state directory; defaults to `CMAKE_INSTALL_PREFIX/var`
 - `USE_SYSTEMD=ON|OFF`: Use systemd or a classic SysV initscript; defaults to `OFF`
-- `INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON|OFF` Force install both the systemd service definition file 
-and the SysV initscript in parallel, regardless of how `USE_SYSTEMD` is set. 
+- `INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON|OFF` Force install both the systemd service definition file
+and the SysV initscript in parallel, regardless of how `USE_SYSTEMD` is set.
 Only use this for special packaging purposes and if you know what you are doing.
 Defaults to `OFF`.
 - `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON`
diff --git a/doc/1-about.md b/doc/1-about.md
index ce3e4d9..c49958a 100644
--- a/doc/1-about.md
+++ b/doc/1-about.md
@@ -54,6 +54,26 @@ Icinga 2 is available as [Vagrant Demo VM](#vagrant).
 
 ## <a id="whats-new"></a> What's new
 
+### What's New in Version 2.2.3
+
+#### Changes
+
+* Bugfixes
+
+#### Issues
+
+* Bug #8063: Volatile checks trigger invalid notifications on OK->OK state changes
+* Bug #8125: Incorrect ticket shouldn't cause "node wizard" to terminate
+* Bug #8126: Icinga 2.2.2 doesn't build on i586 SUSE distributions
+* Bug #8143: Windows plugin check_service.exe can't find service NTDS
+* Bug #8144: Arguments without values are not used on plugin exec
+* Bug #8147: check_interval must be greater than 0 error on update-config
+* Bug #8152: DB IDO query queue limit reached on reload
+* Bug #8171: Typo in example of StatusDataWriter
+* Bug #8178: Icinga 2.2.2 segfaults on FreeBSD
+* Bug #8181: icinga2 node update config shows hex instead of human readable names
+* Bug #8182: Segfault on update-config old empty config
+
 ### What's New in Version 2.2.2
 
 #### Changes
diff --git a/doc/7-configuring-icinga-2.md b/doc/7-configuring-icinga-2.md
index 21b9b9d..fca6cb3 100644
--- a/doc/7-configuring-icinga-2.md
+++ b/doc/7-configuring-icinga-2.md
@@ -1597,7 +1597,7 @@ Example:
 
     object StatusDataWriter "status" {
         status_path = "/var/cache/icinga2/status.dat"
-        objects_path = "/var/cache/icinga2/objects.path"
+        objects_path = "/var/cache/icinga2/objects.cache"
         update_interval = 30s
     }
 
diff --git a/icinga2.spec b/icinga2.spec
index 64cc057..0e1eed2 100644
--- a/icinga2.spec
+++ b/icinga2.spec
@@ -66,7 +66,7 @@
 
 Summary: Network monitoring application
 Name: icinga2
-Version: 2.2.2
+Version: 2.2.3
 Release: %{revision}%{?dist}
 License: GPL-2.0+
 Group: Applications/System
@@ -452,7 +452,8 @@ exit 0
 %{_sbindir}/%{name}
 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
-%{_libdir}/%{name}
+%dir %{_libdir}/%{name}
+%{_libdir}/%{name}/*.so*
 %{_datadir}/%{name}
 %exclude %{_datadir}/%{name}/include
 %{_mandir}/man8/%{name}.8.gz
diff --git a/lib/base/application.cpp b/lib/base/application.cpp
index 869bbd5..d81b32d 100644
--- a/lib/base/application.cpp
+++ b/lib/base/application.cpp
@@ -176,7 +176,7 @@ Application::Ptr Application::GetInstance(void)
 
 void Application::SetResourceLimits(void)
 {
-#ifndef _WIN32
+#ifdef __linux__
 	rlimit rl;
 
 #	ifdef RLIMIT_NOFILE
@@ -252,7 +252,7 @@ void Application::SetResourceLimits(void)
 #	else /* RLIMIT_STACK */
 	Log(LogNotice, "Application", "System does not support adjusting the resource limit for stack size (RLIMIT_STACK)");
 #	endif /* RLIMIT_STACK */
-#endif /* _WIN32 */
+#endif /* __linux__ */
 }
 
 int Application::GetArgC(void)
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 32f9324..811451c 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -139,7 +139,7 @@ void TlsStream::Handshake(void)
 				} catch (const std::exception&) {}
 				continue;
 			case SSL_ERROR_ZERO_RETURN:
-				Close();
+				CloseUnlocked();
 				return;
 			default:
 				msgbuf << "SSL_do_handshake() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
@@ -197,7 +197,7 @@ size_t TlsStream::Read(void *buffer, size_t count)
 					} catch (const std::exception&) {}
 					continue;
 				case SSL_ERROR_ZERO_RETURN:
-					Close();
+					CloseUnlocked();
 					return count - left;
 				default:
 					if (ERR_peek_error() != 0) {
@@ -251,7 +251,7 @@ void TlsStream::Write(const void *buffer, size_t count)
 					} catch (const std::exception&) {}
 					continue;
 				case SSL_ERROR_ZERO_RETURN:
-					Close();
+					CloseUnlocked();
 					return;
 				default:
 					if (ERR_peek_error() != 0) {
@@ -276,6 +276,11 @@ void TlsStream::Close(void)
 {
 	boost::mutex::scoped_lock alock(m_IOActionLock);
 
+	CloseUnlocked();
+}
+
+void TlsStream::CloseUnlocked(void)
+{
 	m_Eof = true;
 
 	for (int i = 0; i < 5; i++) {
diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp
index 1014d81..c6a4055 100644
--- a/lib/base/tlsstream.hpp
+++ b/lib/base/tlsstream.hpp
@@ -67,6 +67,8 @@ private:
 	static int m_SSLIndex;
 	static bool m_SSLIndexInitialized;
 
+	void CloseUnlocked(void);
+
 	static int ValidateCertificate(int preverify_ok, X509_STORE_CTX *ctx);
 	static void NullCertificateDeleter(X509 *certificate);
 };
diff --git a/lib/cli/nodeupdateconfigcommand.cpp b/lib/cli/nodeupdateconfigcommand.cpp
index 8a820e3..57b882d 100644
--- a/lib/cli/nodeupdateconfigcommand.cpp
+++ b/lib/cli/nodeupdateconfigcommand.cpp
@@ -116,13 +116,15 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
 				Dictionary::Ptr old_node = old_node_objs.second;
 				Dictionary::Ptr old_node_repository = old_node->Get("repository");
 
-				ObjectLock olock(old_node_repository);
-				BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
-					String host = kv.first;
+				if (old_node_repository) {
+					ObjectLock olock(old_node_repository);
+					BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
+						String host = kv.first;
 
-					Dictionary::Ptr host_attrs = new Dictionary();
-					host_attrs->Set("name", host);
-					RepositoryUtility::RemoveObject(host, "Host", host_attrs); //this removes all services for this host as well
+						Dictionary::Ptr host_attrs = new Dictionary();
+						host_attrs->Set("name", host);
+						RepositoryUtility::RemoveObject(host, "Host", host_attrs); //this removes all services for this host as well
+					}
 				}
 
 				String zone = old_node->Get("zone");
@@ -143,56 +145,58 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
 				Dictionary::Ptr old_node = old_node_objs.second;
 				Dictionary::Ptr old_node_repository = old_node->Get("repository");
 
-				ObjectLock xlock(old_node_repository);
-				BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
-					String old_host = kv.first;
-
-					if (old_host == "localhost") {
-						Log(LogWarning, "cli")
-						    << "Ignoring host '" << old_host << "'. Please make sure to configure a unique name on your node '" << old_node_name << "'.";
-						continue;
-					}
+				if (old_node_repository) {
+					ObjectLock xlock(old_node_repository);
+					BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
+						String old_host = kv.first;
 
-					/* check against black/whitelist before trying to remove host */
-					if (NodeUtility::CheckAgainstBlackAndWhiteList("blacklist", old_node_name, old_host, Empty) &&
-					    !NodeUtility::CheckAgainstBlackAndWhiteList("whitelist", old_node_name, old_host, Empty)) {
-						Log(LogWarning, "cli")
-						    << "Host '" << old_node << "' on node '" << old_node << "' is blacklisted, but not whitelisted. Skipping.";
-						continue;
-					}
-
-					if (!new_node_repository->Contains(old_host)) {
-						Log(LogInformation, "cli")
-						    << "Node update found old host '" << old_host << "' on node '" << old_node_name << "'. Removing it.";
-
-						Dictionary::Ptr host_attrs = new Dictionary();
-						host_attrs->Set("name", old_host);
-						RepositoryUtility::RemoveObject(old_host, "Host", host_attrs); //this will remove all services for this host too
-					} else {
-						/* host exists, now check all services for this host */
-						Array::Ptr old_services = kv.second;
-						Array::Ptr new_services = new_node_repository->Get(old_host);
-
-						ObjectLock ylock(old_services);
-						BOOST_FOREACH(const String& old_service, old_services) {
-							/* check against black/whitelist before trying to remove service */
-							if (NodeUtility::CheckAgainstBlackAndWhiteList("blacklist", old_node_name, old_host, old_service) &&
-							    !NodeUtility::CheckAgainstBlackAndWhiteList("whitelist", old_node_name, old_host, old_service)) {
-								Log(LogWarning, "cli")
-								    << "Service '" << old_service << "' on host '" << old_host << "' on node '"
-								    << old_node_name << "' is blacklisted, but not whitelisted. Skipping.";
-								continue;
-							}
+						if (old_host == "localhost") {
+							Log(LogWarning, "cli")
+							    << "Ignoring host '" << old_host << "'. Please make sure to configure a unique name on your node '" << old_node_name << "'.";
+							continue;
+						}
 
-							if (!new_services->Contains(old_service)) {
-								Log(LogInformation, "cli")
-								    << "Node update found old service '" << old_service << "' on host '" << old_host
-								    << "' on node '" << old_node_name << "'. Removing it.";
+						/* check against black/whitelist before trying to remove host */
+						if (NodeUtility::CheckAgainstBlackAndWhiteList("blacklist", old_node_name, old_host, Empty) &&
+						    !NodeUtility::CheckAgainstBlackAndWhiteList("whitelist", old_node_name, old_host, Empty)) {
+							Log(LogWarning, "cli")
+							    << "Host '" << old_node_name << "' on node '" << old_node_name << "' is blacklisted, but not whitelisted. Skipping.";
+							continue;
+						}
 
-								Dictionary::Ptr service_attrs = new Dictionary();
-								service_attrs->Set("name", old_service);
-								service_attrs->Set("host_name", old_host);
-								RepositoryUtility::RemoveObject(old_service, "Service", service_attrs);
+						if (!new_node_repository->Contains(old_host)) {
+							Log(LogInformation, "cli")
+							    << "Node update found old host '" << old_host << "' on node '" << old_node_name << "'. Removing it.";
+
+							Dictionary::Ptr host_attrs = new Dictionary();
+							host_attrs->Set("name", old_host);
+							RepositoryUtility::RemoveObject(old_host, "Host", host_attrs); //this will remove all services for this host too
+						} else {
+							/* host exists, now check all services for this host */
+							Array::Ptr old_services = kv.second;
+							Array::Ptr new_services = new_node_repository->Get(old_host);
+
+							ObjectLock ylock(old_services);
+							BOOST_FOREACH(const String& old_service, old_services) {
+								/* check against black/whitelist before trying to remove service */
+								if (NodeUtility::CheckAgainstBlackAndWhiteList("blacklist", old_node_name, old_host, old_service) &&
+								    !NodeUtility::CheckAgainstBlackAndWhiteList("whitelist", old_node_name, old_host, old_service)) {
+									Log(LogWarning, "cli")
+									    << "Service '" << old_service << "' on host '" << old_host << "' on node '"
+									    << old_node_name << "' is blacklisted, but not whitelisted. Skipping.";
+									continue;
+								}
+
+								if (!new_services->Contains(old_service)) {
+									Log(LogInformation, "cli")
+									    << "Node update found old service '" << old_service << "' on host '" << old_host
+									    << "' on node '" << old_node_name << "'. Removing it.";
+
+									Dictionary::Ptr service_attrs = new Dictionary();
+									service_attrs->Set("name", old_service);
+									service_attrs->Set("host_name", old_host);
+									RepositoryUtility::RemoveObject(old_service, "Service", service_attrs);
+								}
 							}
 						}
 					}
diff --git a/lib/cli/nodewizardcommand.cpp b/lib/cli/nodewizardcommand.cpp
index ab5ea64..35ab81d 100644
--- a/lib/cli/nodewizardcommand.cpp
+++ b/lib/cli/nodewizardcommand.cpp
@@ -294,7 +294,7 @@ wizard_ticket:
 			Log(LogCritical, "cli")
 			    << "Failed to fetch signed certificate from master '" << master_host << ", "
 			    << master_port <<"'. Please try again.";
-			return 1;
+			goto wizard_ticket;
 		}
 
 		/* fix permissions (again) when updating the signed certificate */
diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp
index 68da0bb..88a73cb 100644
--- a/lib/db_ido_mysql/idomysqlconnection.cpp
+++ b/lib/db_ido_mysql/idomysqlconnection.cpp
@@ -39,8 +39,8 @@ using namespace icinga;
 REGISTER_TYPE(IdoMysqlConnection);
 REGISTER_STATSFUNCTION(IdoMysqlConnectionStats, &IdoMysqlConnection::StatsFunc);
 
-IdoMysqlConnection::IdoMysqlConnection(void) 
-	: m_Connected(false) 
+IdoMysqlConnection::IdoMysqlConnection(void)
+	: m_QueryQueue(500000), m_Connected(false)
 { }
 
 Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp
index 74fc58f..c36c214 100644
--- a/lib/db_ido_pgsql/idopgsqlconnection.cpp
+++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp
@@ -41,8 +41,8 @@ REGISTER_TYPE(IdoPgsqlConnection);
 
 REGISTER_STATSFUNCTION(IdoPgsqlConnectionStats, &IdoPgsqlConnection::StatsFunc);
 
-IdoPgsqlConnection::IdoPgsqlConnection(void) 
-	: m_Connection(NULL)
+IdoPgsqlConnection::IdoPgsqlConnection(void)
+	: m_QueryQueue(500000), m_Connection(NULL)
 { }
 
 Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp
index 60a39ef..6cf54b9 100644
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -381,10 +381,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 	if (stateChange && old_stateType == StateTypeHard && GetStateType() == StateTypeHard)
 		hardChange = true;
 
-	if (GetVolatile())
-		hardChange = true;
+	bool is_volatile = GetVolatile();
 
-	if (hardChange) {
+	if (hardChange || is_volatile) {
 		SetLastHardStateRaw(new_state);
 		SetLastHardStateChange(now);
 	}
@@ -412,6 +411,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 	if (old_state == ServiceOK && old_stateType == StateTypeSoft)
 		send_notification = false; /* Don't send notifications for SOFT-OK -> HARD-OK. */
 
+	if (is_volatile && old_state == ServiceOK && new_state == ServiceOK)
+		send_notification = false; /* Don't send notifications for volatile OK -> OK changes. */
+
 	bool send_downtime_notification = (GetLastInDowntime() != in_downtime);
 	SetLastInDowntime(in_downtime);
 
@@ -458,17 +460,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 	String old_state_str = (service ? Service::StateToString(old_state) : Host::StateToString(Host::CalculateState(old_state)));
 	String new_state_str = (service ? Service::StateToString(new_state) : Host::StateToString(Host::CalculateState(new_state)));
 
-	if (hardChange) {
+	if (hardChange || is_volatile) {
 		OnStateChange(this, cr, StateTypeHard, origin);
 		Log(LogNotice, "Checkable")
-		    << "State Change: Checkable " << GetName() << " hard state change from " << old_state_str << " to " << new_state_str << " detected.";
+		    << "State Change: Checkable " << GetName() << " hard state change from " << old_state_str << " to " << new_state_str << " detected." << (is_volatile ? " Checkable is volatile." : "");
 	} else if (stateChange) {
 		OnStateChange(this, cr, StateTypeSoft, origin);
 		Log(LogNotice, "Checkable")
 		    << "State Change: Checkable " << GetName() << " soft state change from " << old_state_str << " to " << new_state_str << " detected.";
 	}
 
-	if (GetStateType() == StateTypeSoft || hardChange || recovery)
+	if (GetStateType() == StateTypeSoft || hardChange || recovery || is_volatile)
 		ExecuteEventHandler();
 
 	if (send_downtime_notification)
diff --git a/lib/icinga/checkable.cpp b/lib/icinga/checkable.cpp
index 2dff3d4..6017dd8 100644
--- a/lib/icinga/checkable.cpp
+++ b/lib/icinga/checkable.cpp
@@ -269,7 +269,7 @@ Endpoint::Ptr Checkable::GetCommandEndpoint(void) const
 
 void Checkable::ValidateCheckInterval(const String& location, const Dictionary::Ptr& attrs)
 {
-	if (attrs->Get("check_interval") <= 0) {
+	if (attrs->Contains("check_interval") && attrs->Get("check_interval") <= 0) {
 		ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
 		    location + ": check_interval must be greater than 0.");
 	}
diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp
index 1c21c08..0706f09 100644
--- a/lib/icinga/notification.cpp
+++ b/lib/icinga/notification.cpp
@@ -227,6 +227,9 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 {
 	ASSERT(!OwnsLock());
 
+	Log(LogInformation, "Notification")
+	    << "Attempting to send notifications for notification object '" << GetName() << "'.";
+
 	Checkable::Ptr checkable = GetCheckable();
 
 	if (!force) {
@@ -346,7 +349,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 		}
 
 		Log(LogInformation, "Notification")
-		    << "Sending notification for user '" << userName << "'";
+		    << "Sending notification '" << GetName() << "' for user '" << userName << "'";
 
 		Utility::QueueAsyncCallback(boost::bind(&Notification::ExecuteNotificationHelper, this, type, user, cr, force, author, text));
 
@@ -440,10 +443,10 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User::
 		Service::OnNotificationSentToUser(this, GetCheckable(), user, type, cr, author, text, command->GetName());
 
 		Log(LogInformation, "Notification")
-		    << "Completed sending notification for object '" << GetCheckable()->GetName() << "'";
+		    << "Completed sending notification '" << GetName() << "' for checkable '" << GetCheckable()->GetName() << "'";
 	} catch (const std::exception& ex) {
 		Log(LogWarning, "Notification")
-		    << "Exception occured during notification for object '"
+		    << "Exception occured during notification for checkable '"
 		    << GetCheckable()->GetName() << "': " << DiagnosticInformation(ex);
 	}
 }
diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp
index 783431b..104a9d9 100644
--- a/lib/icinga/pluginutility.cpp
+++ b/lib/icinga/pluginutility.cpp
@@ -186,17 +186,13 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
 
 		Array::Ptr command_arr = command;
 		BOOST_FOREACH(const CommandArgument& arg, args) {
-			Array::Ptr arr;
 
-			if (arg.AValue.IsString())
-				AddArgumentHelper(command_arr, arg.Key, arg.AValue, !arg.SkipKey, !arg.SkipValue);
-			else if (arg.AValue.IsObjectType<Array>())
-				arr = static_cast<Array::Ptr>(arg.AValue);
-			else
+			if (arg.AValue.IsObjectType<Dictionary>()) {
+				Log(LogWarning, "PluginUtility", "Tried to use dictionary in argument");
 				continue;
-
-			if (arr) {
+			} else if (arg.AValue.IsObjectType<Array>()) {
 				bool first = true;
+				Array::Ptr arr = static_cast<Array::Ptr>(arg.AValue);
 
 				ObjectLock olock(arr);
 				BOOST_FOREACH(const Value& value, arr) {
@@ -207,11 +203,11 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
 						add_key = !arg.SkipKey;
 					} else
 						add_key = !arg.SkipKey && arg.RepeatKey;
-						
 
 					AddArgumentHelper(command_arr, arg.Key, value, add_key, !arg.SkipValue);
 				}
-			}
+			} else
+				AddArgumentHelper(command_arr, arg.Key, arg.AValue, !arg.SkipKey, !arg.SkipValue);
 		}
 	}
 
diff --git a/plugins/check_service.cpp b/plugins/check_service.cpp
index ccfd196..f08bd33 100644
--- a/plugins/check_service.cpp
+++ b/plugins/check_service.cpp
@@ -116,7 +116,9 @@ int parseArguments(int ac, wchar_t **av, po::variables_map& vm, printInfoStruct&
 			L" 3\tUNKNOWN, \n\tThe program experienced an internal or input error\n\n"
 			L"%s' thresholds work differently, since a service is either running or not\n"
 			L"all \"-w\" and \"-c\" do is say whether a not running service is a warning\n"
-			L"or critical state respectively.\n"
+			L"or critical state respectively.\n\n"
+			L"Known issue: Since icinga2 runs as NETWORK SERVICE it can't access the access control lists\n"
+			L"it will not be able to find a service like NTDS. To fix this add ACL read permissions to icinga2.\n"
 			, progName, progName);
 		cout << endl;
 		return 0;
diff --git a/test/config/8063.conf b/test/config/8063.conf
new file mode 100644
index 0000000..fe3bcc7
--- /dev/null
+++ b/test/config/8063.conf
@@ -0,0 +1,53 @@
+object CheckCommand "8063-my-disk" {
+  import "plugin-check-command"
+
+  command = [ PluginDir + "/check_disk" ]
+
+  arguments = {
+    "-w" = "$disk_wfree$%"
+    "-c" = "$disk_cfree$%"
+    "-W" = "$disk_inode_wfree$%"
+    "-K" = "$disk_inode_cfree$%"
+    "-p" = "$disk_partitions$"
+    "-x" = "$disk_partitions_excluded$"
+  }
+
+  vars.disk_wfree = 20
+  vars.disk_cfree = 10
+}
+
+object Host "8063-my-server" {
+  import "generic-host"
+  address = "127.0.0.1"
+  address6 = "::1"
+
+  vars.local_disks["basic-partitions"] = {
+    disk_partitions = [ "/", "/tmp", "/var", "/home", "/run/user/1000/gvfs" ]
+  }
+}
+
+apply Service "8063-" for (disk => config in host.vars.local_disks) {
+  import "generic-service"
+  check_command = "8063-my-disk"
+  check_interval = 5s
+  retry_interval = 5s
+
+  volatile = true
+  vars.volatile_check = true
+
+  vars += config
+
+  vars.disk_wfree = 10
+  vars.disk_cfree = 5
+
+  assign where host.vars.local_disks
+}
+
+apply Notification "disk-notification" to Service {
+  import "test-mail-service-notification"
+
+  users = [ "test-icingaadmin" ]
+
+  assign where service.vars.volatile_check == true
+}
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icinga2.git



More information about the Pkg-nagios-changes mailing list