]> granicus.if.org Git - icinga2/commitdiff
Implement the parse_performance_data function
authorGunnar Beutner <gunnar@beutner.name>
Wed, 11 Mar 2015 15:29:20 +0000 (16:29 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 19 Mar 2015 12:38:24 +0000 (13:38 +0100)
fixes #8693

doc/20-library-reference.md
lib/icinga/perfdatavalue.cpp

index e36143b33dadf10522667f32b6ba2c565da9a8a7..b5fa91839f12208470130a6e816142ded886328d 100644 (file)
@@ -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.
 
 ## <a id="object-accessor-functions"></a> Object Accessor Functions
index d643836caa91a5a8334b91fce33e47b18ffb9155..b3e0ae1be6f5e7749047cb5bdbcdcaf0d2dabfac 100644 (file)
@@ -21,6 +21,7 @@
 #include "base/convert.hpp"
 #include "base/exception.hpp"
 #include "base/logger.hpp"
+#include "base/function.hpp"
 #include <boost/algorithm/string/case_conv.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/classification.hpp>
@@ -28,6 +29,7 @@
 using namespace icinga;
 
 REGISTER_TYPE(PerfdataValue);
+REGISTER_SCRIPTFUNCTION(parse_performance_data, PerfdataValue::Parse);
 
 PerfdataValue::PerfdataValue(void)
 { }