Skip to content

add Galera checks to mysql check plugin - #2

Closed
gurubert wants to merge 11 commits into
Checkmk:masterfrom
HeinleinSupport:mysql
Closed

add Galera checks to mysql check plugin#2
gurubert wants to merge 11 commits into
Checkmk:masterfrom
HeinleinSupport:mysql

Conversation

@gurubert

@gurubert gurubert commented May 2, 2019

Copy link
Copy Markdown
Contributor

This pull request adds some MySQL Galera checks.

No modification of the agent plugin is necessary as the required variables will be included if the MySQL instance is part of a Galera cluster.

@gurubert

gurubert commented May 2, 2019

Copy link
Copy Markdown
Contributor Author

BTW: where do I find the comment formatter for the ASCII art?

@LarsMichelsen

Copy link
Copy Markdown
Member

Use: doc/helpers/figheader BlaBla

@LarsMichelsen
LarsMichelsen requested a review from si-23 May 3, 2019 07:26

@si-23 si-23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please yapf the check plugin file

Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
Comment thread checks/mysql Outdated
gurubert and others added 5 commits May 7, 2019 22:20
@gurubert

gurubert commented May 8, 2019

Copy link
Copy Markdown
Contributor Author

Please review again, the new commits should fix the issues.

LarsMichelsen pushed a commit that referenced this pull request Jun 26, 2019
…LWA, #2

- it script allows parameter
- correctly joined path on developer machines
- applied to missing files too

Change-Id: I1fe571ed183aec520adac8954c9e7915859941e0
LarsMichelsen pushed a commit that referenced this pull request Jun 26, 2019
…LWA, #2

- it script allows parameter
- correctly joined path on developer machines
- applied to missing files too

Change-Id: I1fe571ed183aec520adac8954c9e7915859941e0
LarsMichelsen added a commit that referenced this pull request Jul 4, 2019
Change-Id: I9e7d831aff879df6e0c51d85978ff24d3207e600
@si-23 si-23 self-assigned this Jul 30, 2019
si-23
si-23 previously approved these changes Jul 30, 2019

@si-23 si-23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes for next reviews:

  1. Please rebase on master; the first changes are already done
  2. Please yapf the file, otherwise formatter tests would fail
  3. Transfer comments on the first sub galera check to other galera sub checks

I've fixed above comments and add your changes.

Comment thread checks/mysql

def inventory_mysql_galerasync(parsed):
for instance, values in parsed.iteritems():
if values.get('wsrep_provider', 'none') != 'none' and u'wsrep_local_state_comment' in values:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values.get('KEY') is not None

  1. 'get' returns None if key not found
  2. use 'is' operator for checking agains object's identity ('==' to check equality)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has been written that way because wsrep_provider may also return False if set and then the if does not eval correctly.

@si-23 si-23 Jul 30, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it does:

`

d = {}
d['k'] = False
d.get('k', 'none') != 'none'
True
d.get('k') is not None
True
d.get('l', 'none') != 'none'
False
d.get('l') is not None
False
`

Comment thread checks/mysql Outdated
state = 0
else:
state = 2
return (state, 'WSREP local state comment: %s' % values[u'wsrep_local_state_comment'])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite to:

wsrep_local_state_comment = data.get('wsrep_local_state_comment')
if wsrep_local_state_comment is None:
    return
if wsrep_local_state_comment == 'Synced':
    state = 0
else:
    state = 2
return state, 'WSREP local state comment: %s' % wsrep_local_state_comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. less indentation
  2. one lookup instead of two
  3. more readable

Comment thread checks/mysql Outdated
yield instance, {}

@get_parsed_item_data
def check_mysql_galerasync(item, _no_params, values):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convention; rename: values => data
(decorator says "get parsed item DATA")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see commit 95d1f2e

Comment thread checks/mysql Outdated
if values[u'wsrep_sst_donor'] == params['wsrep_sst_donor']:
return (0, 'WSREP sst donor contains "%s"' % values[u'wsrep_sst_donor'])
else:
return (1, 'WSREP sst donor contains "%s" and not "%s"' % (values[u'wsrep_sst_donor'], params['wsrep_sst_donor']))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

levels/params should be placed in brackets as other checks do:
if state: infotext += " (was at discovery %s)"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see commit d9300d4

Comment thread checks/mysql Outdated
"inventory_function" : inventory_mysql_galerasync,
"check_function" : check_mysql_galerasync,
"service_description" : "MySQL Galera Sync %s",
"has_perfdata" : False,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the default, can be removed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see commit 8437746

@si-23 si-23 closed this Jul 30, 2019
@si-23

si-23 commented Jul 30, 2019

Copy link
Copy Markdown
Member

The man pages are missing. Please deliver them in addition.

@si-23 si-23 reopened this Jul 30, 2019
@si-23
si-23 dismissed their stale review July 30, 2019 13:57

It is very hot in the office, sorry

@si-23

si-23 commented Jul 31, 2019

Copy link
Copy Markdown
Member

.. will be merged with werk 8824

@si-23 si-23 closed this Jul 31, 2019
LarsMichelsen added a commit that referenced this pull request Jul 15, 2020
Add the breadcrumb for all page types pages

Change-Id: I1245df381a19e89ef8658a6c40def2d41c78ba12
LarsMichelsen pushed a commit that referenced this pull request Jul 22, 2020
CMK-5044

Change-Id: Ibce3e77c83c851a80214b650f416676d4b128856
LarsMichelsen pushed a commit that referenced this pull request Aug 19, 2020
…re closes sockets before stream.flush done during logging. Method #2

Change-Id: I2872a11257b17c4823e7651bab488def3ae53816
LarsMichelsen pushed a commit that referenced this pull request Sep 17, 2020
Change-Id: I75de9f36b738510927039df1d37233239bd51630
LarsMichelsen added a commit that referenced this pull request Sep 25, 2020
The validation of the plugin parameters in a ruleset took a lot
of time since the lookups for the plugins of a ruleset were not
optizimied. Now using a simple lookup table for this.

Change-Id: Ie6043a353c48d27ad337801015d4d50df052a1d0
LarsMichelsen pushed a commit that referenced this pull request Oct 6, 2020
All files in agent/windows/plugins

Change-Id: I1247ec8553303970ca6144f1d84af67194827d6c
LarsMichelsen pushed a commit that referenced this pull request Oct 22, 2020
Pass the stats with the payload.

CMK-5909

Change-Id: Icf2c6a8691eda9b89d9cabe59abf9024d88ecd24
LarsMichelsen pushed a commit that referenced this pull request Oct 22, 2020
Removed check_maanger.get_check()
--> moved to Check()

Checks are loaded via "config_load_all_checks" fixture

All tests from j-z

Change-Id: I36abf53ce2bd7128291961e7d7ddda24607c3de1
LarsMichelsen pushed a commit that referenced this pull request Oct 30, 2020
* Add serializable data store that contains the information needed by
  every SNMP fetcher.

CMK-5462

Change-Id: If776dc9e1b5a2cb5604cea3667de56473af01a87
LarsMichelsen added a commit that referenced this pull request Nov 9, 2020
Change-Id: I1f6da9b62e8ad6d910b61c70952f3e8c8bf34aa5
LarsMichelsen added a commit that referenced this pull request Nov 9, 2020
Change-Id: I3957af67acd000f98d163ad91baadf31aa465f98
LarsMichelsen added a commit that referenced this pull request Nov 27, 2020
Use VisualLinkSpec in more places.

CMK-5654

Change-Id: I5427ba54510adf2acc62165013d3307ac771b674
LarsMichelsen added a commit that referenced this pull request Dec 2, 2020
Change-Id: Ib1e9d89976c74de99683206aa2a714b2776eed08
LarsMichelsen added a commit that referenced this pull request Dec 2, 2020
Change-Id: Ib1e9d89976c74de99683206aa2a714b2776eed08
LarsMichelsen pushed a commit that referenced this pull request Dec 2, 2020
because SRP 😛

Now it is clear that the parser does not parse as much as it
separates the piggybacked sections from the not-piggybacked ones.

CMK-6516

Change-Id: I29746ad2063fb4bdbbd72dc87e74fc9c4d9ce21a
LarsMichelsen pushed a commit that referenced this pull request Dec 3, 2020
- set packaged type if check_mk.install.yml exists and [global][install] == "no"
- extend few unit-tests

Change-Id: I4141e337637333b1722fb9ab25a791bf00ee2ef1
LarsMichelsen pushed a commit that referenced this pull request Dec 3, 2020
- set packaged type if check_mk.install.yml exists and [global][install] == "no"
- extend few unit-tests

Change-Id: I4141e337637333b1722fb9ab25a791bf00ee2ef1
LarsMichelsen pushed a commit that referenced this pull request Dec 4, 2020
The Checkmk GitHub repository has no Enterprise features.
Thats why we can't test them in these unit tests.

Change-Id: Ic2fad538d9f13d8477e06105dc673650df25fd96
LarsMichelsen pushed a commit that referenced this pull request Dec 18, 2020
- cfg.cpp #2
- remove strange .clang.tidy

Change-Id: I9e45a48d4ad5e7f2462835812be77c05de0cc206
LarsMichelsen pushed a commit that referenced this pull request Dec 18, 2020
- cfg.cpp #2
- remove strange .clang.tidy

Change-Id: I9e45a48d4ad5e7f2462835812be77c05de0cc206
LarsMichelsen pushed a commit that referenced this pull request Jan 25, 2021
Additional change to Werk 11930.
The link would only work if no host was determined.
Now it works with host aswell.

Change-Id: Icdda404451cc58991bb91f385cf792cd02799013
LarsMichelsen pushed a commit that referenced this pull request Jan 25, 2021
Additional change to Werk 11930.
The link would only work if no host was determined.
Now it works with host aswell.

Change-Id: Icdda404451cc58991bb91f385cf792cd02799013
LarsMichelsen pushed a commit that referenced this pull request Jan 26, 2021
Change-Id: I4f01b3e3d884e78ae78390487e298fa03080183d
LarsMichelsen pushed a commit that referenced this pull request Jan 26, 2021
Change-Id: I4f01b3e3d884e78ae78390487e298fa03080183d
LarsMichelsen pushed a commit that referenced this pull request Jan 28, 2021
The shortcut menu now hides the title for an icon if configured.

Change-Id: I4c085ead3c3dbde0e8f607663af765eb04e6eaf0
LarsMichelsen pushed a commit that referenced this pull request Jan 28, 2021
The shortcut menu now hides the title for an icon if configured.

Change-Id: I4c085ead3c3dbde0e8f607663af765eb04e6eaf0
LarsMichelsen pushed a commit that referenced this pull request Feb 3, 2021
CMK-7076

Change-Id: I87aa0a873f272b066bc9ca40af1bdab08bd415b0
LarsMichelsen pushed a commit that referenced this pull request Feb 3, 2021
CMK-7076

Change-Id: I87aa0a873f272b066bc9ca40af1bdab08bd415b0
LarsMichelsen pushed a commit that referenced this pull request May 4, 2021
* We need an rsync *with* chown option (we knew that before...)
* The need rpm was only moved...

Change-Id: I0cb3de2ecc9e02600e868caa1b7fad60500aedce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants