From 228aafc94526e959b790bf21838cbc7555c7829e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 11 Mar 2015 16:29:20 +0100 Subject: [PATCH] Implement the parse_performance_data function fixes #8693 --- doc/20-library-reference.md | 1 + lib/icinga/perfdatavalue.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/20-library-reference.md b/doc/20-library-reference.md index 53727d05b..43b14d01d 100644 --- a/doc/20-library-reference.md +++ b/doc/20-library-reference.md @@ -18,6 +18,7 @@ log(value) | Writes a message to the log. Non-string values log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string. typeof(value) | Returns the type object for a value. get_time() | Returns the current UNIX timestamp. +parse_performance_data(pd) | Parses a performance data string and returns an array describing the values. exit(integer) | Terminates the application. ## Object Accessor Functions diff --git a/lib/icinga/perfdatavalue.cpp b/lib/icinga/perfdatavalue.cpp index d643836ca..b3e0ae1be 100644 --- a/lib/icinga/perfdatavalue.cpp +++ b/lib/icinga/perfdatavalue.cpp @@ -21,6 +21,7 @@ #include "base/convert.hpp" #include "base/exception.hpp" #include "base/logger.hpp" +#include "base/function.hpp" #include #include #include @@ -28,6 +29,7 @@ using namespace icinga; REGISTER_TYPE(PerfdataValue); +REGISTER_SCRIPTFUNCTION(parse_performance_data, PerfdataValue::Parse); PerfdataValue::PerfdataValue(void) { }