Improve log messages.

Refs #6070
This commit is contained in:
Gunnar Beutner 2014-05-23 19:07:44 +02:00
parent 778b51ab6d
commit 820b1a340c
1 changed files with 3 additions and 2 deletions

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/checkable.h" #include "icinga/checkable.h"
#include "icinga/service.h"
#include "icinga/checkcommand.h" #include "icinga/checkcommand.h"
#include "icinga/icingaapplication.h" #include "icinga/icingaapplication.h"
#include "icinga/cib.h" #include "icinga/cib.h"
@ -402,10 +403,10 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
if (hardChange) { if (hardChange) {
OnStateChange(GetSelf(), cr, StateTypeHard, origin); OnStateChange(GetSelf(), cr, StateTypeHard, origin);
Log(LogNotice, "icinga", "State Change: Checkable " + GetName() + " hard state change from " + Convert::ToString(old_state) + " to " + Convert::ToString(new_state) + " detected."); Log(LogNotice, "icinga", "State Change: Checkable " + GetName() + " hard state change from " + Service::StateToString(old_state) + " to " + Service::StateToString(new_state) + " detected.");
} else if (stateChange) { } else if (stateChange) {
OnStateChange(GetSelf(), cr, StateTypeSoft, origin); OnStateChange(GetSelf(), cr, StateTypeSoft, origin);
Log(LogNotice, "icinga", "State Change: Checkable " + GetName() + " soft state change from " + Convert::ToString(old_state) + " to " + Convert::ToString(new_state) + " detected."); Log(LogNotice, "icinga", "State Change: Checkable " + GetName() + " soft state change from " + Service::StateToString(old_state) + " to " + Service::StateToString(new_state) + " detected.");
} }
if (GetStateType() == StateTypeSoft || hardChange || recovery) if (GetStateType() == StateTypeSoft || hardChange || recovery)