Module: check_mk
Branch: master
Commit: 1aa327a0485e34494b483da27a39ba9d4b42cc1b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1aa327a0485e34…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 1 14:50:36 2013 +0200
Remove unused code
---
livestatus/src/LogEntry.cc | 149 --------------------------------------------
1 file changed, 149 deletions(-)
diff --git a/livestatus/src/LogEntry.cc b/livestatus/src/LogEntry.cc
index e25d328..67437fc 100644
--- a/livestatus/src/LogEntry.cc
+++ b/livestatus/src/LogEntry.cc
@@ -259,155 +259,6 @@ inline bool LogEntry::handleStatusEntry()
return false;
}
-// Function is UNUSED and under DEVELOPMENT
-// Might replace the handleStatusEntry function one day
-// Its purpose is to reduce the amount of strcmp to speedup
-// the read process. Risk: LOGCLASS Classification accuracy might suffer
-inline bool LogEntry::handleStatusEntryBetter()
-{
- int len_text = strlen(_text);
- if (len_text < 12)
- return false;
-
- // Patterns
-// "INITIAL SERVICE STATE: "
-// "CURRENT SERVICE STATE: "
-// "SERVICE ALERT: "
-// "SERVICE DOWNTIME ALERT: "
-// "SERVICE FLAPPING ALERT: "
-// "TIMEPERIOD TRANSITION: "
-// "INITIAL HOST STATE: "
-// "CURRENT HOST STATE: "
-// "HOST ALERT: "
-// "HOST DOWNTIME ALERT: "
-// "HOST FLAPPING ALERT: "
-
- // SERVICES
- if (!strncmp(_text, "SERVICE", 7) || !strncmp(_text + 8,
"SERVICE", 7)) {
- bool is_state = false;
- if (!strncmp(_text, "INITIAL", 7)) {
- _logclass = LOGCLASS_STATE;
- _type = STATE_SERVICE_INITIAL;
- is_state = true;
- } else if (!strncmp(_text + 8, "ALERT", 5)) {
- _logclass = LOGCLASS_ALERT;
- _type = ALERT_SERVICE;
- is_state = true;
- } else if (!strncmp(_text, "CURRENT", 7)) {
- _logclass = LOGCLASS_STATE;
- _type = STATE_SERVICE;
- is_state = true;
- }
- if (is_state) {
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _svc_desc = next_token(&scan, ';');
- _state = serviceStateToInt(save_next_token(&scan, ';'));
- _state_type = next_token(&scan, ';');
- _attempt = atoi(save_next_token(&scan, ';'));
- _check_output = next_token(&scan, ';');
- return true;
- }
-
- if (!strncmp(_text + 8, "DOWNTIME", 8)){
- _logclass = LOGCLASS_ALERT;
- _type = DOWNTIME_ALERT_SERVICE;
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _svc_desc = next_token(&scan, ';');
- _state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
- return true;
- } else if (!strncmp(_text + 8, "FLAPPING", 8)) {
- _logclass = LOGCLASS_ALERT;
- _type = FLAPPING_SERVICE;
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _svc_desc = next_token(&scan, ';');
- _state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
- return true;
- }
- } else if (!strncmp(_text, "HOST", 5) || !strncmp(_text + 8,
"HOST", 5)) {
- bool is_state = false;
- if (!strncmp(_text, "INITIAL", 7)) {
- _logclass = LOGCLASS_STATE;
- _type = STATE_HOST_INITIAL;
- is_state = true;
- } else if (!strncmp(_text + 6, "ALERT", 5)) {
- _logclass = LOGCLASS_ALERT;
- _type = ALERT_HOST;
- is_state = true;
- } else if (!strncmp(_text, "CURRENT", 7)) {
- _logclass = LOGCLASS_STATE;
- _type = STATE_HOST;
- is_state = true;
- }
- if (is_state) {
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _svc_desc = next_token(&scan, ';');
- _state = serviceStateToInt(save_next_token(&scan, ';'));
- _state_type = next_token(&scan, ';');
- _attempt = atoi(save_next_token(&scan, ';'));
- _check_output = next_token(&scan, ';');
- return true;
- }
- else if (!strncmp(_text + 6, "DOWNTIME", 8))
- {
- _logclass = LOGCLASS_ALERT;
- _type = DOWNTIME_ALERT_HOST;
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
- return true;
- }
- else if (!strncmp(_text + 6, "HOST FLAPPING ALERT: ", 8))
- {
- _logclass = LOGCLASS_ALERT;
- _type = FLAPPING_HOST;
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _host_name = next_token(&scan, ';');
- _state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
- return true;
- }
-
- }
- else if (!strncmp(_text, "TIMEPERIOD TRANSITION: ", 23))
- {
- _logclass = LOGCLASS_STATE;
- _type = TIMEPERIOD_TRANSITION;
- char *scan = _text;
- _text = next_token(&scan, ':');
- scan++;
-
- _command_name = next_token(&scan, ';');
- _check_output = next_token(&scan, ';');
- _state_type = next_token(&scan, ';');
- return true;
- }
- return false;
-}
inline bool LogEntry::handleNotificationEntry()