Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Community Edition
-
Ubuntu 16.04 LTS, Virtual Machine, Postgresql 9.5 Perl 5.22.1
Description
The unix-agent script "postgresql.pl" is not working on postgres 9.2 and above. From Postgresql 9.2 the "current_query" in pg_stat_activity was split to two columns "state" and "query" causing the postgresql.pl script bundled with observium to cast a "Execution failed" error message.
Source: [https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#pg_stat_activity_and_pg_stat_replication.27s_definitions_have_changed
]
The workaround would be to make a check for postgres version and have two different queries.
Best Regards.
Lets just get the correct counts, for idle and the query type:
# get the stats
# count the total number of connection to the server (right now)
$cCount++; # increment the connection count
}
}
} # parse query type. probably useless
# find idle, select, update, delete, other
$idle++;
}
$select++;
}
elsif (lc($all->{query}) =~ /^update/) {
$update++;
}
elsif (lc($all->{query}) =~ /^delete/) {
$delete++;
}
$other++;
}
}
}
This is counting the "idle in transaction" as just idle...