Skip to content

custom_query perfdata multi-row output improvements #122

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
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
initialize perfdata variables before comparison
Fixes error ` Use of uninitialized value in string ne`
  • Loading branch information
swanson8r authored Sep 25, 2017
commit a71996c56d7b88b9976672f6ef88ad2e10948771
5 changes: 4 additions & 1 deletion check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4404,7 +4404,10 @@ sub check_custom_query {
## use the second column value as the perfdata name,
## use the result value as the perfdata value.
Copy link
Author

Choose a reason for hiding this comment

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

Added comments to explain exactly how the query results are processed into performance data

my $perfname;
my $perfdata;
my $perfdata = '';
if (! defined $db->{perf}){
$db->{perf} = '';
}
Copy link
Author

Choose a reason for hiding this comment

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

Initialize perfdata variables before they are compared

my $grandtotal = @{$db->{slurp}};
Copy link
Author

Choose a reason for hiding this comment

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

check the number of rows returned by the custom query

Copy link
Author

Choose a reason for hiding this comment

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

Get the returned custom query row count

for my $r (@{$db->{slurp}}) {
my $result = $r->{result};
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy