| 352 | } |
| 353 | |
| 354 | void 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 | |
| 390 | void CompatLogger::ExternalCommandHandler(const String& command, const std::vector<String>& arguments) |
| 391 | { |