Monitoring postgres on linux

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
edwardzg
Posts: 21
Joined: Fri Jan 10, 2014 5:11 am

Monitoring postgres on linux

Post by edwardzg »

Hi everybody,

Have anyone good solution to monitor avg query runtime (or the same query on each database to compare it) on each postgres databases?

At this moment to monitor postgres I use check_postgres but i can't find solution for this.


Regards,
Edward
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring postgres on linux

Post by abrist »

You will most likely need to write a wrapper script to run multiple queries (and maybe even bash time the query) and then compare the results.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
edwardzg
Posts: 21
Joined: Fri Jan 10, 2014 5:11 am

Re: Monitoring postgres on linux

Post by edwardzg »

Ok it's good idea but it takes me to much time :| I need something quite simple. Check_postgres plugin have a few actions with queries but I don't know how to use it right.
For example when i use query_time on 30GB postgres db i get output: POSTGRES_QUERY_TIME CRITICAL: (host IP) longest query: 52533s
Why this action give me information about the longest query? :|

It's possible to run action: query_runtime which some standard query for postgres. Standard query because i want have some output to compare a few databases.

Thanks for any idea:)


Regards,
Edward
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitoring postgres on linux

Post by slansing »

You should be able to run the plugin and pass it a -h flag to see the usage/help output, this may help you sculpt a proper check command:

Code: Select all

/path/to/plugin/check_postgres -h
Locked