Example #1
0
		void post_process(T &filter) {
			filter.match_post();
			Plugin::QueryResponseMessage::Response::Line *line = response->add_lines();
			modern_filter::perf_writer writer(*line);
			line->set_message(filter.get_message());
			//filter.end_match();
			filter.fetch_perf(&writer);
			if ((data.empty_state != "ignored") && (!filter.summary.has_matched()))
				response->set_result(nscapi::protobuf::functions::nagios_status_to_gpb(nscapi::plugin_helper::translateReturn(data.empty_state)));
			else
				response->set_result(nscapi::protobuf::functions::nagios_status_to_gpb(filter.summary.returnCode));
		}
Example #2
0
	std::string operator() (const std::string channel, const Plugin::Common::Header &hdr, const Plugin::QueryResponseMessage::Response &payload) {
		if (payload.has_alias())
			return payload.alias();
		return payload.command();
	}
Example #3
0
	std::string operator() (const std::string channel, const Plugin::Common::Header &hdr, const Plugin::QueryResponseMessage::Response &payload) {
		return utf8::cvt<std::string>(nscapi::plugin_helper::translateReturn(nscapi::protobuf::functions::gbp_to_nagios_status(payload.result())));
	}
Example #4
0
	std::string operator() (const std::string channel, const Plugin::Common::Header &hdr, const Plugin::QueryResponseMessage::Response &payload) {
		return payload.message();
	}
Example #5
0
void SimpleFileWriter::handleNotification(const std::string &channel, const Plugin::QueryResponseMessage::Response &request, Plugin::SubmitResponseMessage::Response *response, const Plugin::SubmitRequestMessage &request_message) {
	std::string key;
	BOOST_FOREACH(index_lookup_function &f, index_lookup_) {
		key += f(request.command(), request_message.header(), request);
	}
Example #6
0
void NSCPClient::handleNotification(const std::string &channel, const Plugin::QueryResponseMessage::Response &request, Plugin::SubmitResponseMessage::Response *response, const Plugin::SubmitRequestMessage &request_message) {
	client::configuration config(command_prefix, boost::shared_ptr<clp_handler_impl>(new clp_handler_impl()), boost::shared_ptr<target_handler>(new target_handler(targets)));
	setup(config, request_message.header());
	commands.parse_submit(command_prefix, default_command, request.command(), config, request, *response, request_message);
}