Skip to content

Commit

Permalink
remove stats from loadbalancers, wasn't working anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
apoxa committed Jun 9, 2021
1 parent d9e427d commit 6a6dc5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
17 changes: 1 addition & 16 deletions agent_based/nsx_loadbalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,14 @@ def parse_nsx_loadbalancer(string_table: StringTable) -> SECTION:
parsed: SECTION = {}

for line in string_table:
instance = parsed.setdefault(
parsed.setdefault(
line[0],
{
"id": line[1],
"status": line[2],
"enabled": line[3],
},
)
for key, index in [
("l4_current_sessions", 4),
("l4_max_sessions", 5),
("l4_total_sessions", 6),
("l4_current_session_rate", 7),
("l7_current_sessions", 8),
("l7_max_sessions", 9),
("l7_total_sessions", 10),
("l7_current_session_rate", 11),
]:
try:
value = int(line[index])
except (IndexError, ValueError):
continue
instance.setdefault(key, value)

return parsed

Expand Down
13 changes: 2 additions & 11 deletions agents/special/agent_nsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,17 @@ def process_nsx_lb_status():
output("<<<nsx_loadbalancer:sep(59)>>>")
for lb_service in nsx_lb_service_status["results"]:
lb_service_info = query_nsx_lb_service_details(lb_service["id"])
lb_stats = query_nsx_lb_service_stats(lb_service["id"])
lb_name = lb_service["display_name"]
lb_id = lb_service["id"]
lb_enabled = lb_service["enabled"]
lb_status = lb_service_info["service_status"]
output(
"%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%s"
"%s;%s;%s;%s"
% (
lb_name,
lb_id,
lb_status,
lb_enabled,
lb_stats["l4_current_sessions"],
lb_stats["l4_max_sessions"],
lb_stats["l4_total_sessions"],
lb_stats["l4_current_session_rate"],
lb_stats["l7_current_sessions"],
lb_stats["l7_max_sessions"],
lb_stats["l7_total_sessions"],
lb_stats["l7_current_session_rate"],
lb_enabled
)
)

Expand Down
2 changes: 1 addition & 1 deletion package
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"name": "Check_NSX",
"title": "Checkmk extension for NSX-T 3.x",
"version": "0.4.2",
"version": "0.4.3",
"version.min_required": "2.0.0",
"version.packaged": "2.0.0",
}

0 comments on commit 6a6dc5b

Please sign in to comment.