add Galera checks to mysql check plugin - #2
Conversation
|
BTW: where do I find the comment formatter for the ASCII art? |
|
Use: |
si-23
left a comment
There was a problem hiding this comment.
Please yapf the check plugin file
Use readable strings; no internal strings If-block only checks the state, drag infotext out
|
Please review again, the new commits should fix the issues. |
…LWA, #2 - it script allows parameter - correctly joined path on developer machines - applied to missing files too Change-Id: I1fe571ed183aec520adac8954c9e7915859941e0
…LWA, #2 - it script allows parameter - correctly joined path on developer machines - applied to missing files too Change-Id: I1fe571ed183aec520adac8954c9e7915859941e0
Change-Id: I9e7d831aff879df6e0c51d85978ff24d3207e600
si-23
left a comment
There was a problem hiding this comment.
Notes for next reviews:
- Please rebase on master; the first changes are already done
- Please yapf the file, otherwise formatter tests would fail
- Transfer comments on the first sub galera check to other galera sub checks
I've fixed above comments and add your changes.
|
|
||
| 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: |
There was a problem hiding this comment.
values.get('KEY') is not None
- 'get' returns None if key not found
- use 'is' operator for checking agains object's identity ('==' to check equality)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
`
| state = 0 | ||
| else: | ||
| state = 2 | ||
| return (state, 'WSREP local state comment: %s' % values[u'wsrep_local_state_comment']) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
- less indentation
- one lookup instead of two
- more readable
| yield instance, {} | ||
|
|
||
| @get_parsed_item_data | ||
| def check_mysql_galerasync(item, _no_params, values): |
There was a problem hiding this comment.
convention; rename: values => data
(decorator says "get parsed item DATA")
| 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'])) |
There was a problem hiding this comment.
levels/params should be placed in brackets as other checks do:
if state: infotext += " (was at discovery %s)"
| "inventory_function" : inventory_mysql_galerasync, | ||
| "check_function" : check_mysql_galerasync, | ||
| "service_description" : "MySQL Galera Sync %s", | ||
| "has_perfdata" : False, |
There was a problem hiding this comment.
that's the default, can be removed
|
The man pages are missing. Please deliver them in addition. |
|
.. will be merged with werk 8824 |
Add the breadcrumb for all page types pages Change-Id: I1245df381a19e89ef8658a6c40def2d41c78ba12
CMK-5044 Change-Id: Ibce3e77c83c851a80214b650f416676d4b128856
…re closes sockets before stream.flush done during logging. Method #2 Change-Id: I2872a11257b17c4823e7651bab488def3ae53816
Change-Id: I75de9f36b738510927039df1d37233239bd51630
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
All files in agent/windows/plugins Change-Id: I1247ec8553303970ca6144f1d84af67194827d6c
Pass the stats with the payload. CMK-5909 Change-Id: Icf2c6a8691eda9b89d9cabe59abf9024d88ecd24
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
* Add serializable data store that contains the information needed by every SNMP fetcher. CMK-5462 Change-Id: If776dc9e1b5a2cb5604cea3667de56473af01a87
Change-Id: I1f6da9b62e8ad6d910b61c70952f3e8c8bf34aa5
Change-Id: I3957af67acd000f98d163ad91baadf31aa465f98
Use VisualLinkSpec in more places. CMK-5654 Change-Id: I5427ba54510adf2acc62165013d3307ac771b674
Change-Id: Ib1e9d89976c74de99683206aa2a714b2776eed08
Change-Id: Ib1e9d89976c74de99683206aa2a714b2776eed08
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
- set packaged type if check_mk.install.yml exists and [global][install] == "no" - extend few unit-tests Change-Id: I4141e337637333b1722fb9ab25a791bf00ee2ef1
- set packaged type if check_mk.install.yml exists and [global][install] == "no" - extend few unit-tests Change-Id: I4141e337637333b1722fb9ab25a791bf00ee2ef1
The Checkmk GitHub repository has no Enterprise features. Thats why we can't test them in these unit tests. Change-Id: Ic2fad538d9f13d8477e06105dc673650df25fd96
- cfg.cpp #2 - remove strange .clang.tidy Change-Id: I9e45a48d4ad5e7f2462835812be77c05de0cc206
- cfg.cpp #2 - remove strange .clang.tidy Change-Id: I9e45a48d4ad5e7f2462835812be77c05de0cc206
Additional change to Werk 11930. The link would only work if no host was determined. Now it works with host aswell. Change-Id: Icdda404451cc58991bb91f385cf792cd02799013
Additional change to Werk 11930. The link would only work if no host was determined. Now it works with host aswell. Change-Id: Icdda404451cc58991bb91f385cf792cd02799013
Change-Id: I4f01b3e3d884e78ae78390487e298fa03080183d
Change-Id: I4f01b3e3d884e78ae78390487e298fa03080183d
The shortcut menu now hides the title for an icon if configured. Change-Id: I4c085ead3c3dbde0e8f607663af765eb04e6eaf0
The shortcut menu now hides the title for an icon if configured. Change-Id: I4c085ead3c3dbde0e8f607663af765eb04e6eaf0
CMK-7076 Change-Id: I87aa0a873f272b066bc9ca40af1bdab08bd415b0
CMK-7076 Change-Id: I87aa0a873f272b066bc9ca40af1bdab08bd415b0
* We need an rsync *with* chown option (we knew that before...) * The need rpm was only moved... Change-Id: I0cb3de2ecc9e02600e868caa1b7fad60500aedce
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.