Skip to content

custom_query performance data duplication #69

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

Open
petere opened this issue Jun 19, 2014 · 0 comments
Open

custom_query performance data duplication #69

petere opened this issue Jun 19, 2014 · 0 comments

Comments

@petere
Copy link
Contributor

petere commented Jun 19, 2014

When custom_query returns multiple rows, their performance data string is duplicated in subsequent rows. For example:

./check_postgres.pl --action=custom_query --dbname=postgres --dbuser=peisentraut --warning=100 --query="select 30 as result, 'foo' as data union select 20, 'bar' union select 10, 'baz' order by 1 desc"

POSTGRES_CUSTOM_QUERY OK: DB "postgres" 30 * 20 * 10 | time=0.08s data=foo;100 time=0.08s data=foo;100 data=bar;100 time=0.08s data=foo;100 data=bar;100; data=baz;100

Correct would be

POSTGRES_CUSTOM_QUERY OK: DB "postgres" 30 * 20 * 10 | time=0.08s data=foo;100 time=0.08s data=bar;100 time=0.08s data=baz;100

The fix appears to be to change line 4100

$db->{perf} .= sprintf ' %s=%s;%s;%s',

to

$db->{perf} = sprintf ' %s=%s;%s;%s',
swanson8r added a commit to swanson8r/check_postgres that referenced this issue Sep 25, 2017
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