1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #ifndef PLUGINUTILITY_H
4 #define PLUGINUTILITY_H
6 #include "icinga/i2-icinga.hpp"
7 #include "icinga/checkable.hpp"
8 #include "icinga/checkcommand.hpp"
9 #include "icinga/macroprocessor.hpp"
18 * Utility functions for plugin-based checks.
25 static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
26 const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
27 const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int timeout,
28 const std::function<void(const Value& commandLine, const ProcessResult&)>& callback = std::function<void(const Value& commandLine, const ProcessResult&)>());
30 static ServiceState ExitStatusToState(int exitStatus);
31 static std::pair<String, String> ParseCheckOutput(const String& output);
33 static Array::Ptr SplitPerfdata(const String& perfdata);
34 static String FormatPerfdata(const Array::Ptr& perfdata);
42 #endif /* PLUGINUTILITY_H */