@cryptotaxi247 / netdata-1 / commits / 2d9b7f323

Using positive error codes in portcheck

Chris committed Feb 20, 2018 at 19:17 UTC 2d9b7f32332fab1655516e5fc2b11ffe87e1f3cc
2 files changed +8 -8
python.d/README.md
+5 -5
@@ -1555,14 +1555,14 @@ Following charts are drawn per host:
1555 1. **Latency** ms
1556 * For each port: TCP socket opening and closing time when connecting.
1557 Displays latency in 0.1 ms resolution and 0.1ms will be the minimum.
1558 - If it is 0.0ms, the connection failed (useful for API)
1558 + If it is 0.0ms, the connection failed with error code >0 (useful for API)
1559
1560 2. **Error code** int
1561 * For each port: One of:
1562 - - 0: Connection successful
1563 - - -1: Could not create socket (dns name not resolved?)
1564 - - -2: Connection refused (port not listening or blocked)
1565 - - -3: Connection timed out (host unreachable?)
1562 + - 0: Connection successful
1563 + - 1: Could not create socket (dns name not resolved?)
1564 + - 2: Connection refused (port not listening or blocked)
1565 + - 3: Connection timed out (host unreachable?)
1566
1567
1568 ### configuration
python.d/portcheck.chart.py
+3 -3
@@ -24,9 +24,9 @@ CHARTS = {
24 ]}
25 }
26
27 -SOCKET_FAILED = -1
28 -CONNECTION_FAILED = -2
29 -CONNECTION_TIMED_OUT = -3
27 +SOCKET_FAILED = 1
28 +CONNECTION_FAILED = 2
29 +CONNECTION_TIMED_OUT = 3
30
31 TCP_DIMENSION_CONNECT_PREFIX = 'tcp_connect_'
32 TCP_DIMENSION_ERROR_PREFIX = 'tcp_error_'