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

check_mattermost doesn't show actual patched version #2

Open
muristan opened this issue Oct 27, 2020 · 1 comment
Open

check_mattermost doesn't show actual patched version #2

muristan opened this issue Oct 27, 2020 · 1 comment

Comments

@muristan
Copy link

muristan commented Oct 27, 2020

Mattermost Team Edition
Mattermost: Vers. 5.28.1 Database schema version: 5.28.0

curl -i https://mm.beispiel.de 2>/dev/null | grep 'X-Version-Id' | grep -oE '([0-9]{1,}.)+[0-9]{1,}'
5.28.0.5.28.1.46

This is probably a problem of the mattermost server self. The desctop client shows the actual version. But the curl command displays X-Version-Id: 5.28.0.5.28.1
curl displays first database schema version followed by the build number.

This results in icinga2 warning messages if -p (mattermost_patch) is enabled - nevertheless the patch is installed.

Howto correct the line
curl -i https://mm.beispiel.de 2>/dev/null | grep 'X-Version-Id' | grep -oE '([0-9]{1,}.)+[0-9]{1,}'
to show just the build number?

@muristan muristan changed the title mattermost server doesn't show actual patched version check_mattermost doesn't show actual patched version Oct 28, 2020
@muristan
Copy link
Author

muristan commented Oct 28, 2020

I replaced the line
m_version="$(curl -i $MATTERMOST_URL 2>/dev/null | grep 'X-Version-Id' | grep -oE '([0-9]{1,}.)+[0-9]{1,}')"
with
TOKEN=$(curl -i -d '{"login_id":"user","password":"secret"}' https://mm.beispiel.de:/api/v4/users/login 2>/dev/null | grep Token | grep -oP '(?<=Token: )[ A-Za-z0-9]*')
m_version=$(curl -i -H 'Authorization: Bearer $TOKEN' https://mm.beispiel.de:/api/v4/config/client?format=old 2>/dev/null | grep '^{' | jq -r '.BuildNumber')

Works!

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

1 participant