Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Output. Status=unknown, Message= #2

Open
nieldejonghe opened this issue Feb 23, 2021 · 5 comments
Open

No Output. Status=unknown, Message= #2

nieldejonghe opened this issue Feb 23, 2021 · 5 comments

Comments

@nieldejonghe
Copy link

Hello Kevin,

I've struggled with whitelisting my nagios servers IP in the monitoring whitelist IP in gitlab, maybe it could be good if you put that in your doc as prereq?

I've tried out your plugin in our nagios configuration but i'm not receiving any output.
If I run a curl to my gitlab url I do receive output.

root@:/srv/nagios/libexec# curl -k https:///-/readiness?all=1
{"db_check":{"status":"ok"},"redis_check":{"status":"ok"},"cache_check":{"status":"ok"},"queues_check":{"status":"ok"},"shared_state_check":{"status":"ok"},"gitaly_check":{"status":"ok","labels":{"shard":"default"}}}

Output from check_gitlab
root@:/srv/nagios/libexec# ./check_gitlab -s https:/// --check-all
Cache check: Status=unknown, Message=
Database check: Status=unknown, Message=
Gitaly check: Status=unknown, Message=
Queues check: Status=unknown, Message=
Redis check: Status=unknown, Message=
Shared state check: Status=unknown, Message=
6 checks done.

Any Idea in how to troubleshoot this?
Kind Regards,
Niel

@nieldejonghe
Copy link
Author

Hello Kevin,

I've struggled with whitelisting my nagios servers IP in the monitoring whitelist IP in gitlab, maybe it could be good if you put that in your doc as prereq?

I've tried out your plugin in our nagios configuration but i'm not receiving any output.
If I run a curl to my gitlab url I do receive output.

root@:/srv/nagios/libexec# curl -k https:///-/readiness?all=1
{"db_check":{"status":"ok"},"redis_check":{"status":"ok"},"cache_check":{"status":"ok"},"queues_check":{"status":"ok"},"shared_state_check":{"status":"ok"},"gitaly_check":{"status":"ok","labels":{"shard":"default"}}}

Output from check_gitlab
root@:/srv/nagios/libexec# ./check_gitlab -s https:/// --check-all
Cache check: Status=unknown, Message=
Database check: Status=unknown, Message=
Gitaly check: Status=unknown, Message=
Queues check: Status=unknown, Message=
Redis check: Status=unknown, Message=
Shared state check: Status=unknown, Message=
6 checks done.

Any Idea in how to troubleshoot this?
Kind Regards,
Niel

I was able to fix it by removing the [0] option in the "check_module" function

def check_module(readiness_json, module):
    try:
        status = readiness_json[module]["status"]
    except:
        status = "unknown"
    try:
        message = readiness_json[module]["message"]
    except:
        message = ""
    return status, message

@KevinKrumbiegel
Copy link
Owner

Hi Niel!
Thank you for the helpful issue.
Indeed, something is broken there and I'm just fixing it right now.

I will also edit the README to accept your proposal. :)

@KevinKrumbiegel
Copy link
Owner

KevinKrumbiegel commented Feb 24, 2021

Hi @nieldejonghe ,

I just found out that my GitLab Server responds differently than yours.

On my GitLab Server the response is:
{"status":"ok","master_check":[{"status":"ok"}],"db_check":[{"status":"ok"}],"redis_check":[{"status":"ok"}],"cache_check":[{"status":"ok"}],"queues_check":[{"status":"ok"}],"shared_state_check":[{"status":"ok"}],"gitaly_check":[{"status":"ok","labels":{"shard":"default"}}]}

I currently use GitLab Enterprise Edition 13.9.1-ee. May I ask you what version you are using? (Just check your server's help page at gitlab.example.org/help).
As you fixed this issue for yourself right now, the overall fix in this repo will come during the next week. I will do some further refactorings that will take some time.

However, thank you very much for bringing up this issue!

@nieldejonghe
Copy link
Author

Hello @KevinKrumbiegel,

I just checked my gitlab server today, current version is pretty old 'GitLab Enterprise Edition 12.2.4-ee '
I guess I should update asap! :)

Kind Regards,
Niel Dejonghe

@kfiresmith
Copy link

Hi Folks,
In case it helps, there are different health checks in GitLab 15x. I'm on 15.7.5 for example:

curl http://localhost/-/readiness?all=1 | jq

{
  "status": "ok",
  "master_check": [
    {
      "status": "ok"
    }
  ],
  "db_check": [
    {
      "status": "ok"
    }
  ],
  "cache_check": [
    {
      "status": "ok"
    }
  ],
  "queues_check": [
    {
      "status": "ok"
    }
  ],
  "rate_limiting_check": [
    {
      "status": "ok"
    }
  ],
  "sessions_check": [
    {
      "status": "ok"
    }
  ],
  "shared_state_check": [
    {
      "status": "ok"
    }
  ],
  "trace_chunks_check": [
    {
      "status": "ok"
    }
  ],
  "gitaly_check": [
    {
      "status": "ok",
      "labels": {
        "shard": "default"
      }
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants