Index: modules/NRPEListener/NRPEListener.cpp
===================================================================
--- modules/NRPEListener/NRPEListener.cpp	(revision 1d9338a9bf5d49d7f5786147e410c06a09f970b0)
+++ modules/NRPEListener/NRPEListener.cpp	(revision e26cfe0ac3f18dddf4ec02dfc2e1f878460a1499)
@@ -86,11 +86,4 @@
 }
 
-std::string NRPEListener::getModuleName() {
-	return "NRPE module.";
-}
-NSCModuleWrapper::module_version NRPEListener::getModuleVersion() {
-	NSCModuleWrapper::module_version version = {0, 0, 1 };
-	return version;
-}
 
 bool NRPEListener::hasCommandHandler() {
@@ -126,5 +119,41 @@
 	if ((str.substr(0,6) == "inject")&&(str.length() > 7)) {
 		strEx::token t = strEx::getToken(str.substr(7), ' ');
-		return NSCModuleHelper::InjectSplitAndCommand(t.first, t.second, ' ', message, perf);
+		std::string s = t.second;
+		std::string sTarget;
+
+		std::string::size_type p = 0;
+		while(true) {
+			std::string::size_type pStart = p;
+			std::string::size_type pEnd = std::string::npos;
+			if (s[p] == '\"') {
+				pStart++;
+				while (true) {
+					p = s.find(' ', ++p);
+					if (p == std::string::npos)
+						break;
+					if ((p>1)&&(s[p-1]=='\"')&&(((p>2)&&(s[p-2]!='\\'))||(p==2)))
+						break;
+				}
+				if (p != std::string::npos)
+					pEnd = p-1;
+				else
+					pEnd = s.length()-1;
+
+			} else {
+				pEnd = p = s.find(' ', ++p);
+			}
+			if (!sTarget.empty())
+				sTarget += "!";
+			if (p == std::string::npos) {
+				if (pEnd == std::string::npos)
+					sTarget += s.substr(pStart);
+				else
+					sTarget += s.substr(pStart, pEnd-pStart);
+				break;
+			}
+			sTarget += s.substr(pStart,pEnd-pStart);
+			p++;
+		}
+		return NSCModuleHelper::InjectSplitAndCommand(t.first, sTarget, '!', message, perf);
 	}
 
@@ -312,2 +341,60 @@
 NSC_WRAPPERS_IGNORE_MSG_DEF();
 NSC_WRAPPERS_HANDLE_CMD_DEF(gNRPEListener);
+NSC_WRAPPERS_HANDLE_CONFIGURATION(gNRPEListener);
+
+
+MODULE_SETTINGS_START(NRPEListener, "NRPE Listsner configuration", "...")
+
+PAGE("NRPE Listsner configuration")
+
+ITEM_EDIT_TEXT("port", "This is the port the NRPEListener.dll will listen to.")
+ITEM_MAP_TO("basic_ini_text_mapper")
+OPTION("section", "NRPE")
+OPTION("key", "port")
+OPTION("default", "5666")
+ITEM_END()
+
+ITEM_CHECK_BOOL("allow_arguments", "This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.")
+ITEM_MAP_TO("basic_ini_bool_mapper")
+OPTION("section", "NRPE")
+OPTION("key", "allow_arguments")
+OPTION("default", "false")
+OPTION("true_value", "1")
+OPTION("false_value", "0")
+ITEM_END()
+
+ITEM_CHECK_BOOL("allow_nasty_meta_chars", "This might have security implications (depending on what you do with the options)")
+ITEM_MAP_TO("basic_ini_bool_mapper")
+OPTION("section", "NRPE")
+OPTION("key", "allow_nasty_meta_chars")
+OPTION("default", "false")
+OPTION("true_value", "1")
+OPTION("false_value", "0")
+ITEM_END()
+
+ITEM_CHECK_BOOL("use_ssl", "This option will enable SSL encryption on the NRPE data socket (this increases security somwhat.")
+ITEM_MAP_TO("basic_ini_bool_mapper")
+OPTION("section", "NRPE")
+OPTION("key", "use_ssl")
+OPTION("default", "true")
+OPTION("true_value", "1")
+OPTION("false_value", "0")
+ITEM_END()
+
+PAGE_END()
+ADVANCED_PAGE("Access configuration")
+
+ITEM_EDIT_OPTIONAL_LIST("Allow connection from:", "This is the hosts that will be allowed to poll performance data from the NRPE server.")
+OPTION("disabledCaption", "Use global settings (defined previously)")
+OPTION("enabledCaption", "Specify hosts for NRPE server")
+OPTION("listCaption", "Add all IP addresses (not hosts) which should be able to connect:")
+OPTION("separator", ",")
+OPTION("disabled", "")
+ITEM_MAP_TO("basic_ini_text_mapper")
+OPTION("section", "NRPE")
+OPTION("key", "allowed_hosts")
+OPTION("default", "")
+ITEM_END()
+
+PAGE_END()
+MODULE_SETTINGS_END()
Index: modules/NRPEListener/NRPEListener.def
===================================================================
--- modules/NRPEListener/NRPEListener.def	(revision 2a94f3f96fe7206c1c2fe79eb45fa00e7d97556e)
+++ modules/NRPEListener/NRPEListener.def	(revision e26cfe0ac3f18dddf4ec02dfc2e1f878460a1499)
@@ -11,3 +11,4 @@
 	NSHandleCommand
 	NSUnloadModule
-
+	NSGetConfigurationMeta
+	NSGetModuleDescription
Index: modules/NRPEListener/NRPEListener.h
===================================================================
--- modules/NRPEListener/NRPEListener.h	(revision 1e62ed50e7d6e4f3454ba6e866236e885a056ce0)
+++ modules/NRPEListener/NRPEListener.h	(revision e26cfe0ac3f18dddf4ec02dfc2e1f878460a1499)
@@ -21,9 +21,21 @@
 	bool loadModule();
 	bool unloadModule();
-	std::string getModuleName();
-	NSCModuleWrapper::module_version getModuleVersion();
+
+
+	std::string getModuleName() {
+		return "NRPE server";
+	}
+	NSCModuleWrapper::module_version getModuleVersion() {
+		NSCModuleWrapper::module_version version = {0, 0, 1 };
+		return version;
+	}
+	std::string getModuleDescription() {
+		return "A simple server that listens for incoming NRPE connection and handles them.\nNRPE is preferred over NSClient as it is more flexible. You can of cource use both NSClient and NRPE.";
+	}
+
 	bool hasCommandHandler();
 	bool hasMessageHandler();
 	NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, char **char_args, std::string &message, std::string &perf);
+	std::string getConfigurationMeta();
 
 private:
