@cryptotaxi247 / netdata-1 / commits / e9833435d

Renumbered error codes

Chris committed Feb 21, 2018 at 16:30 UTC e9833435dcbb26bb59c62d751665e65d39cd1401
2 files changed +11 -7
python.d/httpcheck.chart.py
+8 -4
@@ -36,10 +36,14 @@ CHARTS = {
36 ]}
37 }
38
39 -CONTENT_MISMATCH = 1
40 -STATUS_NOT_ACCEPTED = 2
41 -CONNECTION_TIMED_OUT = 3
42 -CONNECTION_FAILED = 4
39 +# The higher the error code, the "more severe" it is. E.g. an unreachable host is probably much worse than a regex
40 +# mismatch (maybe the web service just has a new design that doesn't match the regex anymore).
41 +# We use steps of 5, which allows future fine-grained error codes, should we need it (fill the blanks where
42 +# appropriate).
43 +CONTENT_MISMATCH = 3
44 +STATUS_NOT_ACCEPTED = 5
45 +CONNECTION_TIMED_OUT = 10
46 +CONNECTION_FAILED = 15
47
48
49 class Service(UrlService):
web/dashboard_info.js
+3 -3
@@ -1144,9 +1144,9 @@ netdataDashboard.context = {
1144 'httpcheck.error': {
1145 valueRange: "[0, 3]",
1146 info: 'The <code>Error</code> is returned by the plugin when it could not connect to the webserver. It is one of: ' +
1147 - '<code>0</code> (connection successful), <code>1</code> (unexpected response content), <code>2</code> (unexpected status code), ' +
1148 - '<code>3</code> (port unreachable), <code>4</code> (host unreachable). ' +
1149 - 'The error code is most useful for 3rd-party apps and alarms.'
1147 + '<code>0</code> (connection successful), <code>3</code> (unexpected response content), <code>5</code> (unexpected status code), ' +
1148 + '<code>10</code> (port unreachable), <code>15</code> (host unreachable). ' +
1149 + 'The higher the error code, the "more severe" it is. The error code is most useful for 3rd-party apps and alarms.'
1150 },
1151
1152 // ------------------------------------------------------------------------