Navigation Menu

Skip to content

Commit

Permalink
Fix problem with livestatus filter "type"
Browse files Browse the repository at this point in the history
There was a regression in changeset 3d4e48a for issue 10449 that
made the "class" filter work, but broke the "type" filter. Reverting some changes seems to do the
trick.

refs #10449

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
  • Loading branch information
Michael Kraus authored and Michael Friedrich committed Dec 2, 2015
1 parent 678a237 commit 5b7421a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/livestatus/livestatuslogutility.cpp
Expand Up @@ -147,7 +147,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)

/* set default values */
bag->Set("class", LogEntryClassInfo);
bag->Set("type", 0);
bag->Set("log_type", 0);
bag->Set("state", 0);
bag->Set("attempt", 0);
bag->Set("message", text); /* used as 'message' in log table, and 'log_output' in statehist table */
Expand All @@ -166,15 +166,15 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)

if (type.Contains("INITIAL HOST STATE")) {
bag->Set("class", LogEntryClassState);
bag->Set("type", LogEntryTypeHostInitialState);
bag->Set("log_type", LogEntryTypeHostInitialState);
}
else if (type.Contains("CURRENT HOST STATE")) {
bag->Set("class", LogEntryClassState);
bag->Set("type", LogEntryTypeHostCurrentState);
bag->Set("log_type", LogEntryTypeHostCurrentState);
}
else {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeHostAlert);
bag->Set("log_type", LogEntryTypeHostAlert);
}

return bag;
Expand All @@ -189,10 +189,10 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)

if (type.Contains("HOST FLAPPING ALERT")) {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeHostFlapping);
bag->Set("log_type", LogEntryTypeHostFlapping);
} else {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeHostDowntimeAlert);
bag->Set("log_type", LogEntryTypeHostDowntimeAlert);
}

return bag;
Expand All @@ -211,15 +211,15 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)

if (type.Contains("INITIAL SERVICE STATE")) {
bag->Set("class", LogEntryClassState);
bag->Set("type", LogEntryTypeServiceInitialState);
bag->Set("log_type", LogEntryTypeServiceInitialState);
}
else if (type.Contains("CURRENT SERVICE STATE")) {
bag->Set("class", LogEntryClassState);
bag->Set("type", LogEntryTypeServiceCurrentState);
bag->Set("log_type", LogEntryTypeServiceCurrentState);
}
else {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeServiceAlert);
bag->Set("log_type", LogEntryTypeServiceAlert);
}

return bag;
Expand All @@ -235,10 +235,10 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)

if (type.Contains("SERVICE FLAPPING ALERT")) {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeServiceFlapping);
bag->Set("log_type", LogEntryTypeServiceFlapping);
} else {
bag->Set("class", LogEntryClassAlert);
bag->Set("type", LogEntryTypeServiceDowntimeAlert);
bag->Set("log_type", LogEntryTypeServiceDowntimeAlert);
}

return bag;
Expand All @@ -247,7 +247,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
return bag;

bag->Set("class", LogEntryClassState);
bag->Set("type", LogEntryTypeTimeperiodTransition);
bag->Set("log_type", LogEntryTypeTimeperiodTransition);

bag->Set("host_name", tokens[0]);
bag->Set("service_description", tokens[1]);
Expand All @@ -265,7 +265,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
bag->Set("plugin_output", tokens[5]);

bag->Set("class", LogEntryClassNotification);
bag->Set("type", LogEntryTypeHostNotification);
bag->Set("log_type", LogEntryTypeHostNotification);

return bag;
} else if (type.Contains("SERVICE NOTIFICATION")) {
Expand All @@ -281,7 +281,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
bag->Set("plugin_output", tokens[6]);

bag->Set("class", LogEntryClassNotification);
bag->Set("type", LogEntryTypeServiceNotification);
bag->Set("log_type", LogEntryTypeServiceNotification);

return bag;
} else if (type.Contains("PASSIVE HOST CHECK")) {
Expand Down Expand Up @@ -314,17 +314,17 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
return bag;
} else if (type.Contains("LOG VERSION")) {
bag->Set("class", LogEntryClassProgram);
bag->Set("type", LogEntryTypeVersion);
bag->Set("log_type", LogEntryTypeVersion);

return bag;
} else if (type.Contains("logging initial states")) {
bag->Set("class", LogEntryClassProgram);
bag->Set("type", LogEntryTypeInitialStates);
bag->Set("log_type", LogEntryTypeInitialStates);

return bag;
} else if (type.Contains("starting... (PID=")) {
bag->Set("class", LogEntryClassProgram);
bag->Set("type", LogEntryTypeProgramStarting);
bag->Set("log_type", LogEntryTypeProgramStarting);

return bag;
}
Expand Down

0 comments on commit 5b7421a

Please sign in to comment.