Comment 0 for bug 1783923

Revision history for this message
Paul Collins (pjdc) wrote :

I just got an alert for "CRITICAL: Exception while attempting to check InfluxDB".

This turned out to be because:

$ sudo -u nagios /usr/local/lib/nagios/plugins/check_influxdb.py
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: getsockopt: connection refused
Please check your connection settings and ensure 'influxd' is running.
CRITICAL: Exception while attempting to check InfluxDB
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/check_influxdb.py", line 29, in <module>
    output = subprocess.check_output(cmd)
  File "/usr/lib/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['influx', '-execute', 'show diagnostics', '-format', 'json', '-username', 'nagios', '-password', 'hieshohdu4Ledoodav']' returned non-zero exit status 1
$ _

The check should capture output and include it in its output when a command fails.