Fix passive check results.

Fixes #5970
This commit is contained in:
Gunnar Beutner 2014-04-08 15:36:45 +02:00
parent 80778bad1d
commit 4a32ca9123
3 changed files with 154 additions and 403 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,18 +39,10 @@ public:
static boost::signals2::signal<void (double, const String&, const std::vector<String>&)> OnNewExternalCommand;
private:
typedef boost::function<void (double time, const std::vector<String>& arguments)> Callback;
static boost::once_flag m_InitializeOnce;
static boost::mutex m_Mutex;
static std::map<String, Callback> m_Commands;
ExternalCommandProcessor(void);
static void Initialize(void);
static void RegisterCommand(const String& command, const Callback& callback);
static void ProcessHostCheckResult(double time, const std::vector<String>& arguments);
static void ProcessServiceCheckResult(double time, const std::vector<String>& arguments);
static void ScheduleHostCheck(double time, const std::vector<String>& arguments);

View File

@ -141,12 +141,18 @@ String PluginUtility::FormatPerfdata(const Value& perfdata)
bool first = true;
BOOST_FOREACH(const Dictionary::Pair& kv, dict) {
String key;
if (kv.first.FindFirstOf(" ") != String::NPos)
key = "'" + kv.first + "'";
else
key = kv.first;
if (!first)
result << " ";
else
first = false;
result << kv.first << "=" << PerfdataValue::Format(kv.second);
result << key << "=" << PerfdataValue::Format(kv.second);
}
return result.str();