)]}'
{"nagios/plugins/check_exporter_health_metric.py":[{"author":{"_account_id":18250,"name":"Roy Tang","email":"roy.s.tang@att.com","username":"rt7380"},"change_message_id":"5d3b66a9640ee6364b881db00c9b5deb2cde4ee3","unresolved":true,"context_lines":[{"line_number":114,"context_line":"                metric_with_labels, value \u003d metric.split(\" \")"},{"line_number":115,"context_line":"                metrics[metric_with_labels] \u003d float(value)"},{"line_number":116,"context_line":"        except Exception as e:"},{"line_number":117,"context_line":"            if retry \u003c max_retry:"},{"line_number":118,"context_line":"                retry +\u003d 1"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            error_messages.append("},{"line_number":121,"context_line":"                \"ERROR retrieving exporter endpoint {}\".format("},{"line_number":122,"context_line":"                    str(e)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3b170738_9ebf5671","line":119,"range":{"start_line":117,"start_character":1,"end_line":119,"end_character":24},"updated":"2021-07-30 15:40:51.000000000","message":"this is more a global comment, would it be beneficial to add a print/log statement to all these little retry block in order to capture when a retry happens?  For one, it will help with testing, for two, if someone sees lots of retry in logs, they may want to take a closer look at the env to see what is going on.  just a thought.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30882,"name":"Christopher Straut","display_name":"Christopher Straut","email":"cs4987@att.com","username":"cs4987@att.com"},"change_message_id":"0ce0dec1a95569cefd37e425d463da336409631d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                metric_with_labels, value \u003d metric.split(\" \")"},{"line_number":115,"context_line":"                metrics[metric_with_labels] \u003d float(value)"},{"line_number":116,"context_line":"        except Exception as e:"},{"line_number":117,"context_line":"            if retry \u003c max_retry:"},{"line_number":118,"context_line":"                retry +\u003d 1"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            error_messages.append("},{"line_number":121,"context_line":"                \"ERROR retrieving exporter endpoint {}\".format("},{"line_number":122,"context_line":"                    str(e)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"997a6c80_4c2aabce","line":119,"range":{"start_line":117,"start_character":1,"end_line":119,"end_character":24},"in_reply_to":"3b170738_9ebf5671","updated":"2021-07-30 19:03:12.000000000","message":"Adding a print statement in the retry logic so that it is apparent that the request is timing out.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"}],"nagios/plugins/check_rest_get_api.py":[{"author":{"_account_id":18250,"name":"Roy Tang","email":"roy.s.tang@att.com","username":"rt7380"},"change_message_id":"5d3b66a9640ee6364b881db00c9b5deb2cde4ee3","unresolved":true,"context_lines":[{"line_number":113,"context_line":"        netloc\u003d\"{}:{}@{}\".format(parsed.username, \"???\", parsed.hostname))"},{"line_number":114,"context_line":"    screened_url \u003d replaced.geturl()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    retry \u003d 0"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    while retry \u003c max_retry:"},{"line_number":119,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"45cb6e4a_5b8a6b03","line":116,"range":{"start_line":116,"start_character":0,"end_line":116,"end_character":13},"updated":"2021-07-30 15:40:51.000000000","message":"in all other places, this is initialize to \"retry \u003d 1\", is this intentional here?","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30882,"name":"Christopher Straut","display_name":"Christopher Straut","email":"cs4987@att.com","username":"cs4987@att.com"},"change_message_id":"0ce0dec1a95569cefd37e425d463da336409631d","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        netloc\u003d\"{}:{}@{}\".format(parsed.username, \"???\", parsed.hostname))"},{"line_number":114,"context_line":"    screened_url \u003d replaced.geturl()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    retry \u003d 0"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    while retry \u003c max_retry:"},{"line_number":119,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"005d53e4_514d5619","line":116,"range":{"start_line":116,"start_character":0,"end_line":116,"end_character":13},"in_reply_to":"45cb6e4a_5b8a6b03","updated":"2021-07-30 19:03:12.000000000","message":"That should have been 1, pasted it from another code block.  Will change this back to 1.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":18250,"name":"Roy Tang","email":"roy.s.tang@att.com","username":"rt7380"},"change_message_id":"5d3b66a9640ee6364b881db00c9b5deb2cde4ee3","unresolved":true,"context_lines":[{"line_number":132,"context_line":"                    screened_url, expected_response_codes, response.status_code, response_time))"},{"line_number":133,"context_line":"                sys.exit(STATE_CRITICAL)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"            if response_seconds \u003e\u003d warning_seconds and response_seconds \u003c critical_seconds:"},{"line_number":136,"context_line":"                print(\"WARNING: using URL {} response seconds {} is more than warning threshold {} seconds. {}\".format("},{"line_number":137,"context_line":"                    screened_url, response_seconds, warning_seconds, response_time))"},{"line_number":138,"context_line":"                sys.exit(STATE_WARNING)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"            if response_seconds \u003e\u003d critical_seconds:"},{"line_number":141,"context_line":"                print(\"CRITICAL: using URL {} response seconds {} is more than critical threshold {} seconds. {}\".format("},{"line_number":142,"context_line":"                    screened_url, response_seconds, critical_seconds, response_time))"},{"line_number":143,"context_line":"                sys.exit(STATE_CRITICAL)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"            print(\"OK: URL {} returned response code {}. {}\".format("},{"line_number":146,"context_line":"                screened_url, response.status_code, response_time))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ab34c117_055fa62e","line":143,"range":{"start_line":135,"start_character":1,"end_line":143,"end_character":40},"updated":"2021-07-30 15:40:51.000000000","message":"nit .... logic may flow better (and slightly less expensive) if we check for critical first, then warning.....\n\nif response_seconds \u003e\u003d critical_seconds, print, sys.exit\nif response_seconds \u003e\u003d warning_seoonds, print, sys.exit","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30882,"name":"Christopher Straut","display_name":"Christopher Straut","email":"cs4987@att.com","username":"cs4987@att.com"},"change_message_id":"0ce0dec1a95569cefd37e425d463da336409631d","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                    screened_url, expected_response_codes, response.status_code, response_time))"},{"line_number":133,"context_line":"                sys.exit(STATE_CRITICAL)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"            if response_seconds \u003e\u003d warning_seconds and response_seconds \u003c critical_seconds:"},{"line_number":136,"context_line":"                print(\"WARNING: using URL {} response seconds {} is more than warning threshold {} seconds. {}\".format("},{"line_number":137,"context_line":"                    screened_url, response_seconds, warning_seconds, response_time))"},{"line_number":138,"context_line":"                sys.exit(STATE_WARNING)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"            if response_seconds \u003e\u003d critical_seconds:"},{"line_number":141,"context_line":"                print(\"CRITICAL: using URL {} response seconds {} is more than critical threshold {} seconds. {}\".format("},{"line_number":142,"context_line":"                    screened_url, response_seconds, critical_seconds, response_time))"},{"line_number":143,"context_line":"                sys.exit(STATE_CRITICAL)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"            print(\"OK: URL {} returned response code {}. {}\".format("},{"line_number":146,"context_line":"                screened_url, response.status_code, response_time))"}],"source_content_type":"text/x-python","patch_set":2,"id":"6ef26f5b_a6a638b0","line":143,"range":{"start_line":135,"start_character":1,"end_line":143,"end_character":40},"in_reply_to":"ab34c117_055fa62e","updated":"2021-07-30 19:03:12.000000000","message":"Good point, this logic flow was here before but I like the increasing level of errors in these checks.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"}],"nagios/plugins/query_prometheus_alerts.py":[{"author":{"_account_id":30777,"name":"Steven Fitzpatrick","email":"steven@fitzpatrick.wtf","username":"sf280x"},"change_message_id":"ab77fd19faec491e34c8ad3f13e44a4ddcc1d604","unresolved":true,"context_lines":[{"line_number":179,"context_line":"            error_messages.append("},{"line_number":180,"context_line":"                \"ERROR while invoking prometheus api using URL {}, got error: {}\".format(clean_api_address(prometheus_api), e))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    return response_json, error_messages"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def check_prom_metrics_available(prometheus_api, metrics, labels_csv, timeout):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a599d46_fbd5a52c","line":182,"range":{"start_line":182,"start_character":4,"end_line":182,"end_character":40},"updated":"2021-07-29 16:06:04.000000000","message":"If one of the retries is successful, do we need to clear our the error messages list? I think the main function will short circuit even if the response_json has some valid data: https://opendev.org/openstack/openstack-helm-images/src/branch/master/nagios/plugins/query_prometheus_alerts.py#L81","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30882,"name":"Christopher Straut","display_name":"Christopher Straut","email":"cs4987@att.com","username":"cs4987@att.com"},"change_message_id":"afbf2f2012b42e4eddb705def76b5d1dda0dde8a","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            error_messages.append("},{"line_number":180,"context_line":"                \"ERROR while invoking prometheus api using URL {}, got error: {}\".format(clean_api_address(prometheus_api), e))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    return response_json, error_messages"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def check_prom_metrics_available(prometheus_api, metrics, labels_csv, timeout):"}],"source_content_type":"text/x-python","patch_set":2,"id":"f6f7b704_d1c6115f","line":182,"range":{"start_line":182,"start_character":4,"end_line":182,"end_character":40},"in_reply_to":"3a599d46_fbd5a52c","updated":"2021-07-29 16:14:05.000000000","message":"The error_messages field is only populated once after the retry attempts have exceeded the max_retry count. Also the error_messages is a LIST type so the calling function should expect 0 or more error_messages if they occur.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30777,"name":"Steven Fitzpatrick","email":"steven@fitzpatrick.wtf","username":"sf280x"},"change_message_id":"3765a9a25f2231ffd8251900e2c70fce446c147e","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            error_messages.append("},{"line_number":180,"context_line":"                \"ERROR while invoking prometheus api using URL {}, got error: {}\".format(clean_api_address(prometheus_api), e))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    return response_json, error_messages"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def check_prom_metrics_available(prometheus_api, metrics, labels_csv, timeout):"}],"source_content_type":"text/x-python","patch_set":2,"id":"50e1c796_a1023006","line":182,"range":{"start_line":182,"start_character":4,"end_line":182,"end_character":40},"in_reply_to":"f6f7b704_d1c6115f","updated":"2021-07-29 16:23:34.000000000","message":"I missed the continue statements in there... whoops! Thanks for clarifying","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"}],"nagios/plugins/send_http_post_event.py":[{"author":{"_account_id":18250,"name":"Roy Tang","email":"roy.s.tang@att.com","username":"rt7380"},"change_message_id":"5d3b66a9640ee6364b881db00c9b5deb2cde4ee3","unresolved":true,"context_lines":[{"line_number":17,"context_line":"#                      --state-id 2"},{"line_number":18,"context_line":"#                      --output \u0027PING CRITICAL - Packet loss \u003d 100%\u0027"},{"line_number":19,"context_line":"#                      --monitoring-hostname \u0027nagioshost.x.y.com\u0027"},{"line_number":20,"context_line":"#                      --max-retry-count 3"},{"line_number":21,"context_line":"# sends HTTP POST with following payload:"},{"line_number":22,"context_line":"#    \"HostEvent\":{"},{"line_number":23,"context_line":"#        \"Hostname\":\"hostwithevent.y.x.com\","}],"source_content_type":"text/x-python","patch_set":2,"id":"6d8d5131_61f3db43","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":42},"updated":"2021-07-30 15:40:51.000000000","message":"was the intent to accept max-retry as a parameter, with 5 as default?  You may want to add this logic, or remove this from the doc.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"},{"author":{"_account_id":30882,"name":"Christopher Straut","display_name":"Christopher Straut","email":"cs4987@att.com","username":"cs4987@att.com"},"change_message_id":"0ce0dec1a95569cefd37e425d463da336409631d","unresolved":true,"context_lines":[{"line_number":17,"context_line":"#                      --state-id 2"},{"line_number":18,"context_line":"#                      --output \u0027PING CRITICAL - Packet loss \u003d 100%\u0027"},{"line_number":19,"context_line":"#                      --monitoring-hostname \u0027nagioshost.x.y.com\u0027"},{"line_number":20,"context_line":"#                      --max-retry-count 3"},{"line_number":21,"context_line":"# sends HTTP POST with following payload:"},{"line_number":22,"context_line":"#    \"HostEvent\":{"},{"line_number":23,"context_line":"#        \"Hostname\":\"hostwithevent.y.x.com\","}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0ce7c2_e1167884","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":42},"in_reply_to":"6d8d5131_61f3db43","updated":"2021-07-30 19:03:12.000000000","message":"Yes, the original intent was to add a parameter but I think it makes more sense to just default to retry connections that timeout.","commit_id":"24cedfbf34ea8353dc05b0f31de6c9ff1c6ab4b0"}]}
