Page 1 of 1

Monitoring postgres on linux

Posted: Fri Jan 10, 2014 5:49 am
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

Re: Monitoring postgres on linux

Posted: Fri Jan 10, 2014 11:32 am
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.

Re: Monitoring postgres on linux

Posted: Fri Jan 17, 2014 8:58 am
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

Re: Monitoring postgres on linux

Posted: Fri Jan 17, 2014 3:50 pm
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