MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ForceNextCheckChangedHandler

Method ForceNextCheckChangedHandler

lib/icinga/clusterevents.cpp:646–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646void ClusterEvents::ForceNextCheckChangedHandler(const Checkable::Ptr& checkable, const MessageOrigin::Ptr& origin)
647{
648 ApiListener::Ptr listener = ApiListener::GetInstance();
649
650 if (!listener)
651 return;
652
653 Host::Ptr host;
654 Service::Ptr service;
655 tie(host, service) = GetHostService(checkable);
656
657 Dictionary::Ptr params = new Dictionary();
658 params->Set("host", host->GetName());
659 if (service)
660 params->Set("service", service->GetShortName());
661 params->Set("forced", checkable->GetForceNextCheck());
662
663 Dictionary::Ptr message = new Dictionary();
664 message->Set("jsonrpc", "2.0");
665 message->Set("method", "event::SetForceNextCheck");
666 message->Set("params", params);
667
668 listener->RelayMessage(origin, checkable, message, true);
669}
670
671Value ClusterEvents::ForceNextCheckChangedAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
672{

Callers

nothing calls this directly

Calls 3

RelayMessageMethod · 0.80
SetMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected