Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Stop producing invalid performance data. #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Stop producing invalid performance data. #38

wants to merge 4 commits into from

Conversation

theseal
Copy link

@theseal theseal commented Mar 22, 2017

The performance data should be something graphable, not strings.
Only produce perfdata if that is the case.

The performance data should be something graphable, not strings.
Only produce perfdata if that is the case.
@cezmunsta
Copy link
Collaborator

@theseal please can clarify why you think that the data is not graphable and that the perfdata is valid when it is based upon percentage?

If we take the perfdata from check_load for example, you can see that this is perfectly inline with the code in the pmp-check-mysql-status plugin:

load1=0.000;15.000;30.000;0; load5=0.010;10.000;25.000;0; load15=0.050;5.000;20.000;0;

The following would be the output from pmp-check-mysql-status -P 3306 -H localhost -x Threads_running -w 40 -c 400

Threads_running=1;40;400;0;

Johan Carlquist added 3 commits July 7, 2017 11:42
The performance data should be something graphable, not strings.
Only produce perfdata if that is the case.
My last take on to fix this perfdata didn't work since it's only strings that can't be graphable.
@theseal
Copy link
Author

theseal commented Jul 7, 2017

Seems like my first take on this was to intrusive and didn't work as I expected.

You are right that the check creates valid performance data like in your example.
But what I tried to fix with my first commit was to stop creating performance data when the check was involved with "str" (string) as argument, e.g pmp-check-mysql-status -l nagios -x wsrep_cluster_status -C == -T str -c non-Primary would produce:

OK wsrep_cluster_status (str) = Primary | wsrep_cluster_status=Primary;;non-Primary;0;

which isn't valid performance data.

Since the PR didn't work I updated it to only skip performance data if "str" is used in argument. So with the update the output from pmp-check-mysql-status -l nagios -x wsrep_cluster_status -C == -T str -c non-Primary is

OK wsrep_cluster_status (str) = Primary

and with non string argument pmp-check-mysql-status -l nagios -x wsrep_cluster_size -C '<=' -w 2 -c 1

OK wsrep_cluster_size = 3 | wsrep_cluster_size=3;2;1;0;

Sorry about the confusion.

@cezmunsta
Copy link
Collaborator

@theseal OK, thanks for the clarification. So, are you concerned about the storage/CPU required for the perfdata processing? Right now, you can filter out anything with (str) for your processing.

Since the perfdata format is processor-dependent, I think that silently forcing the removal of the perfdata could leave someone else with a surprise; perhaps they process it differently to you. Here are some examples that you could graph, but which are presented as strings:

| Innodb_buffer_pool_dump_status                | Dumping of buffer pool not started
| Innodb_buffer_pool_load_status                | Buffer pool(s) load completed at 170707 11:11:01
| Ssl_server_not_after                          | Oct 18 16:20:36 2026 GMT 

Taking these on an alert basis, perhaps someone wishes to get an alert regarding buffer pool dump/load (the following is merely an example):

> /usr/lib64/nagios/plugins/pmp-check-mysql-status -H 10.0.1.13 -x Innodb_buffer_pool_dump_status -T str -w "Dumping of buffer pool not"        
WARN Innodb_buffer_pool_dump_status (str) = Dumping of buffer pool not started | Innodb_buffer_pool_dump_status=Dumping of buffer pool not started;Dumping of buffer pool not;;0;

I think that the safest way to achieve what you want without risk to anyone else is to add a new option that allows you to suppress perfdata when setting the check command in Nagios, e.g. --no-perfdata

@theseal
Copy link
Author

theseal commented Jul 7, 2017

My concern is about the error/warning message that the check cause in Icinga2 and maybe other monitoring system:

Mar 22 13:39:35 icinga-test-srv02 icinga2: Ignoring invalid perfdata value: wsrep_local_state_comment=Synced;Synced;;0;#012Context:#012#011(0) Processing check result for 'mysqlcluster!AUTO_wsrep_local_state_comment'
Mar 22 13:40:02 icinga-test-srv02 icinga2[125776]: [2017-03-22 13:39:35 +0100] warning/GraphiteWriter: Ignoring invalid perfdata value: wsrep_local_state_comment=Synced;Synced;;0;

I quess that the perfdata format could be processor-dependent, but I haven't seen any implementation that don't follow the guidelines:
https://nagios-plugins.org/doc/guidelines.html#AEN200

If you think that --no-perfdata is a better idea I can look in to that alternative within a few weeks, but I think it would be better to follow the guidelines since Nagios is some kind of defacto standard.

@basg
Copy link

basg commented Oct 20, 2017

We are experiencing similar issues in our icinga setup, with invalid perfdata leading to warnings being logged when pmp-check-mysql-status is put in string comparison mode.
For this reason it would be convenient to have a --no-perfdata option. Any indication on when this PR may be completed? Thanks!

@eichlerla2
Copy link

We have the same problems in our icinga2 setup. I would be very glad if you could add a --no-perfdata option.

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

Successfully merging this pull request may close these issues.

5 participants