timdaman / check_docker

Nagios plugin to check docker containers
GNU General Public License v3.0
152 stars 60 forks source link

UNKNOWN: Exception raised during check': KeyError('token') #66

Open Al2Klimov opened 4 years ago

Al2Klimov commented 4 years ago

Command line: ["/usr/lib/nagios/plugins/check_docker","--containers","elasticsearch","--present","--restarts","23:42","--status","running","--uptime","120:60","--version"]

Container's image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1

Output:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 985, in main
    [x.result() for x in futures.as_completed(threads)]
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 985, in <listcomp>
    [x.result() for x in futures.as_completed(threads)]
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 623, in check_version
    registry_hash = get_digest_from_registry(url)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 374, in get_digest_from_registry
    registry_info, status_code = get_url(url=url)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 278, in get_url
    response = better_urllib_get.open(url, timeout=timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 133, in http_response
    return self.process_oauth2(request, response, www_authenticate_header)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 162, in process_oauth2
    auth_token = self._get_outh2_token(www_authenticate_header)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 151, in _get_outh2_token
    return process_urllib_response(token_response)['token']
KeyError: 'token'
OK: elasticsearch status is running; OK: elasticsearch restarts is 0; OK: elasticsearch uptime is 4d 23h; UNKNOWN: Exception raised during check': KeyError('token')