Skip to content

Update with new functionality for more detailed monitoring#54

Open
gullevek wants to merge 2 commits intopg-monz:masterfrom
gullevek:master
Open

Update with new functionality for more detailed monitoring#54
gullevek wants to merge 2 commits intopg-monz:masterfrom
gullevek:master

Conversation

@gullevek
Copy link
Copy Markdown
Contributor

NOTE: As the current Zabbix Version is 4.0, the templates were exported
with 4.0 version, but the changes itself are compatible with previous
Zabbix versions.

  • Fixes
    In the standard PostgreSQL and SR template for process selection.
    The standard process name "postgres" is not set on all PostgreSQL
    installations. For example on RPM based systems it is called
    "postmaster". So all calls using this will not work.
    The call has been changed to use the new Macro entry {$PGPROCESS} with
    the default set name "postgres"

Missing "" in some UserParameter calls

  • Updates
    File : pgsql_server_funcs.sh
    Call : pg.transactions
    Add : xlog count (WAL files currently in the WAL folder)
    Item : Transaction log wal segments psql.xlog
    Graph: PostgreSQL Transaction Log

File : pgsql_userdb_funcs.sh
Call : pg.size
Add : detail DB size for index/data/views/sequence/other
Item : [{#DBNAME}] DB Size Data psql.db_size_detail_data[{#DBNAME}]
[{#DBNAME}] DB Size Index psql.db_size_detail_index[{#DBNAME}]
[{#DBNAME}] DB Size Other psql.db_size_detail_other[{#DBNAME}]
[{#DBNAME}] DB Size Sequence psql.db_size_detail_sequence[{#DBNAME}]
[{#DBNAME}] DB Size View psql.db_size_detail_view[{#DBNAME}]
Graph: [{#DBNAME}] DB Size Detail

Changed get Interval for DB Name List pgsql.get.pg.stat_database to 5m
from 1h

  • New
    File : pgsql_userdb_funcs.sh
    Call : pg.scans
    User Parameter:
    UserParameter=pgsql.get.pg.scan[*],"$1"/pgsql_userdb_funcs.sh pg.scan "$2" "$3" "$4" "$5"
    Get : pgsql.get.pg.scans[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
    Interval: 5m
    Item : [{#DBNAME}] Scans Index psql.scans_index[{#DBNAME}]
    [{#DBNAME}] Scans Sequential psql.scans_sequential[{#DBNAME}]
    Graph: [{#DBNAME}] Scan Types

File : pgsql_userdb_funcs.sh
Call : pg.locks
User Parameter:
UserParameter=pgsql.get.pg.locks[*],"$1"/pgsql_userdb_funcs.sh pg.locks "$2" "$3" "$4" "$5"
Get : pgsql.get.pg.locks[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
Interval: 5m
Item : [{#DBNAME}] Locks Access Exclusive psql.locks_accessexclusivelock[{#DBNAME}]
[{#DBNAME}] Locks Access Share psql.locks_accesssharelock[{#DBNAME}]
[{#DBNAME}] Locks Exclusive psql.locks_exclusivelock[{#DBNAME}]
[{#DBNAME}] Locks Row Exclusive psql.locks_rowexclusivelock[{#DBNAME}]
[{#DBNAME}] Locks Row Share psql.locks_rowsharelock[{#DBNAME}]
[{#DBNAME}] Locks Share psql.locks_sharelock[{#DBNAME}]
[{#DBNAME}] Locks Share Row Exclusive psql.locks_sharerowexclusivelock[{#DBNAME}]
[{#DBNAME}] Locks Share Update Exclusive psql.locks_shareupdateexclusivelock[{#DBNAME}]
Graph: [{#DBNAME}] Locks

File : pgsql_userdb_funcs.sh
Call : pg.querylength
User Parameter:
UserParameter=pgsql.get.pg.querylength[*],"$1"/pgsql_userdb_funcs.sh pg.querylength "$2" "$3" "$4" "$5"
Get : pgsql.get.pg.querylength[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
Interval: 5m
Item : [{#DBNAME}] Oldest Query psql.querylength_query[{#DBNAME}]
[{#DBNAME}] Oldest Transaction psql.querylength_transaction[{#DBNAME}]
Graph: [{#DBNAME}] Query Length

NOTE: As the current Zabbix Version is 4.0, the templates were exported
with 4.0 version, but the changes itself are compatible with previous
Zabbix versions.

* Fixes
In the standard PostgreSQL and SR template for process selection.
The standard process name "postgres" is not set on all PostgreSQL
installations. For example on RPM based systems it is called
"postmaster". So all calls using this will not work.
The call has been changed to use the new Macro entry {$PGPROCESS} with
the default set name "postgres"

Missing "" in some UserParameter calls

* Updates
File : pgsql_server_funcs.sh
Call : pg.transactions
Add  : xlog count (WAL files currently in the WAL folder)
Item : Transaction log wal segments  psql.xlog
Graph: PostgreSQL Transaction Log

File : pgsql_userdb_funcs.sh
Call : pg.size
Add  : detail DB size for index/data/views/sequence/other
Item : [{#DBNAME}] DB Size Data      psql.db_size_detail_data[{#DBNAME}]
       [{#DBNAME}] DB Size Index     psql.db_size_detail_index[{#DBNAME}]
       [{#DBNAME}] DB Size Other     psql.db_size_detail_other[{#DBNAME}]
       [{#DBNAME}] DB Size Sequence  psql.db_size_detail_sequence[{#DBNAME}]
       [{#DBNAME}] DB Size View      psql.db_size_detail_view[{#DBNAME}]
Graph: [{#DBNAME}] DB Size Detail

Changed get Interval for DB Name List pgsql.get.pg.stat_database to 5m
from 1h

* New
File : pgsql_userdb_funcs.sh
Call : pg.scans
User Parameter:
UserParameter=pgsql.get.pg.scan[*],"$1"/pgsql_userdb_funcs.sh pg.scan "$2" "$3" "$4" "$5"
Get  : pgsql.get.pg.scans[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
       Interval: 5m
Item : [{#DBNAME}] Scans Index       psql.scans_index[{#DBNAME}]
       [{#DBNAME}] Scans Sequential  psql.scans_sequential[{#DBNAME}]
Graph: [{#DBNAME}] Scan Types

File : pgsql_userdb_funcs.sh
Call : pg.locks
User Parameter:
UserParameter=pgsql.get.pg.locks[*],"$1"/pgsql_userdb_funcs.sh pg.locks "$2" "$3" "$4" "$5"
Get  : pgsql.get.pg.locks[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
       Interval: 5m
Item : [{#DBNAME}] Locks Access Exclusive        psql.locks_accessexclusivelock[{#DBNAME}]
       [{#DBNAME}] Locks Access Share            psql.locks_accesssharelock[{#DBNAME}]
       [{#DBNAME}] Locks Exclusive               psql.locks_exclusivelock[{#DBNAME}]
       [{#DBNAME}] Locks Row Exclusive           psql.locks_rowexclusivelock[{#DBNAME}]
       [{#DBNAME}] Locks Row Share               psql.locks_rowsharelock[{#DBNAME}]
       [{#DBNAME}] Locks Share                   psql.locks_sharelock[{#DBNAME}]
       [{#DBNAME}] Locks Share Row Exclusive     psql.locks_sharerowexclusivelock[{#DBNAME}]
       [{#DBNAME}] Locks Share Update Exclusive  psql.locks_shareupdateexclusivelock[{#DBNAME}]
Graph: [{#DBNAME}] Locks

File : pgsql_userdb_funcs.sh
Call : pg.querylength
User Parameter:
UserParameter=pgsql.get.pg.querylength[*],"$1"/pgsql_userdb_funcs.sh pg.querylength "$2" "$3" "$4" "$5"
Get  : pgsql.get.pg.querylength[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR},{HOST.HOST},{$ZABBIX_AGENTD_CONF},{#DBNAME}]
       Interval: 5m
Item : [{#DBNAME}] Oldest Query        psql.querylength_query[{#DBNAME}]
       [{#DBNAME}] Oldest Transaction  psql.querylength_transaction[{#DBNAME}]
Graph: [{#DBNAME}] Query Length
@pengbo0328
Copy link
Copy Markdown
Contributor

Thank you for your patch.
I am testing your patch.

zabbix_sender script return has no more "info" name in return value but
"sent" and so the return check needs to be adjusted
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

Successfully merging this pull request may close these issues.

2 participants