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

Method EnableFlappingChangedHandler

lib/compat/compatlogger.cpp:354–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void CompatLogger::EnableFlappingChangedHandler(const Checkable::Ptr& checkable)
355{
356 Host::Ptr host;
357 Service::Ptr service;
358 tie(host, service) = GetHostService(checkable);
359
360 if (checkable->GetEnableFlapping())
361 return;
362
363 String flapping_output = "Flap detection has been disabled";
364 String flapping_state_str = "DISABLED";
365
366 std::ostringstream msgbuf;
367
368 if (service) {
369 msgbuf << "SERVICE FLAPPING ALERT: "
370 << host->GetName() << ";"
371 << service->GetShortName() << ";"
372 << flapping_state_str << "; "
373 << flapping_output
374 << "";
375 } else {
376 msgbuf << "HOST FLAPPING ALERT: "
377 << host->GetName() << ";"
378 << flapping_state_str << "; "
379 << flapping_output
380 << "";
381 }
382
383 {
384 ObjectLock oLock(this);
385 WriteLine(msgbuf.str());
386 Flush();
387 }
388}
389
390void CompatLogger::ExternalCommandHandler(const String& command, const std::vector<String>& arguments)
391{

Callers

nothing calls this directly

Calls 1

GetNameMethod · 0.45

Tested by

no test coverage detected