Skip to content

txn_time/idle flap from OK to UNKNOWN #73

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
martinmarques opened this issue Sep 2, 2014 · 9 comments
Open

txn_time/idle flap from OK to UNKNOWN #73

martinmarques opened this issue Sep 2, 2014 · 9 comments

Comments

@martinmarques
Copy link

I have been dealing with a problem in a new installation I was doing today. The problem came up as I saw in Icinga that txn_time and txn_idle were flapping and for no reason I could think of.

Checking the code, I found that the problem came here:

    ## Return unknown if stats_command_string / track_activities is off
    if ($cq =~ /disabled/o or $cq =~ /<command string not enabled>/) {
        add_unknown msg('psa-disabled');
        return;
    }

What would happen if the query had in some part the word 'disabled'? For example a column of a table which has been selected.

I think this is not the best way to check if a postgres setting is set accordinly.

Removing the offending code (as I'm sure the postgres setting has track_activities on) made everything work as expected.

@petere
Copy link
Contributor

petere commented Sep 12, 2014

seeing the same thing

@martinmarques
Copy link
Author

So, no further comment? I'm starting to see flapping on another monitored system to which I don't have access to check, but I wouldn't be surprised that it related.

If you want to keep the if, at least use something like:

if ($cq =~ /^disabled$/o or $cq =~ /^<command string not enabled>$/) {

This is untested. Just a thought.

I directly removed the offending code.

Cheers,

@martinmarques
Copy link
Author

A pull request was sent but is still waiting.

@sts
Copy link

sts commented Jul 30, 2015

+1 for the patch, having the same issue with queries agaist a table with contains a disabled column.

@sts
Copy link

sts commented Aug 5, 2015

@bucardo any chance to get this fixed soon?

@RajeshMadiwale
Copy link

I am getting ERROR very frequently please could any one tell me how I can over come from this issue?
Some times we are getting expected output and some time UNKNOWN state.

Notification Type: PROBLEM

Service: postgres - txn_idle
Host: XXXXXX
State: UNKNOWN

Additional Info:POSTGRES_TXN_IDLE UNKNOWN: DB XX (host:xxxx) No queries - is stats_command_string or track_activities off?

ERROR is getting from below code(took from check_postgres.pl) but I am unable to find way to over come from it

Return unknown if stats_command_string / track_activities is off

    if ($cq =~ /disabled/o or $cq =~ /<command string not enabled>/) {
        add_unknown msg('psa-disabled');
        return;
    }

@df7cb
Copy link
Collaborator

df7cb commented Sep 27, 2016

@RajeshMadiwale: Are you seeing this also with the git version? If I remember correctly we changed a few bits here since the last tarball release.

@RajeshMadiwale
Copy link

@ChristophBerg I did not tried with git version.
I will check and update you . Thank you Chris

@RajeshMadiwale
Copy link

I have tested with git version and yes I am able to get the correct output.
previously there was issue if table have column name with "disabled" then check_postgres.pl use to give state UNKNOWN.
Thank you Chris

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

5 participants