From 0f87c9d67ededb01f623265e81a4f0d003a16d7a Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 9 Jun 2023 12:25:49 +0200
Subject: [PATCH] 2 more psql templates

---
 iml_psql-activity.ini  |  3 +-
 iml_psql-conflicts.ini |  2 +-
 iml_psql-dbrows.ini    | 11 +------
 iml_psql-diskblock.ini | 40 +++++++++++++++++++++++++
 iml_psql-problems.ini  | 68 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 111 insertions(+), 13 deletions(-)
 create mode 100644 iml_psql-diskblock.ini
 create mode 100644 iml_psql-problems.ini

diff --git a/iml_psql-activity.ini b/iml_psql-activity.ini
index c4e5634..9ec27c9 100644
--- a/iml_psql-activity.ini
+++ b/iml_psql-activity.ini
@@ -1,6 +1,6 @@
 ; ======================================================================
 ;
-;   PSQLSERVER activity
+; PSQLSERVER activity
 ;
 ; ----------------------------------------------------------------------
 ; 2023-06-08  <axel.hahn@unibe.ch>  initial version
@@ -39,4 +39,3 @@ other  = "alias($metric$, 'Other')"
 idle   = "alias($metric$, 'Idle incl. idle in transaction')"
 fast   = "alias($metric$, 'Fastpath function call')"
 active = "alias($metric$, 'Active (values are stacked)')"
-
diff --git a/iml_psql-conflicts.ini b/iml_psql-conflicts.ini
index 39d0391..d3e4a81 100644
--- a/iml_psql-conflicts.ini
+++ b/iml_psql-conflicts.ini
@@ -1,6 +1,6 @@
 ; ======================================================================
 ;
-;   PSQLSERVER conflicts
+; PSQLSERVER conflicts
 ;
 ; ----------------------------------------------------------------------
 ; 2023-06-08  <axel.hahn@unibe.ch>  initial version
diff --git a/iml_psql-dbrows.ini b/iml_psql-dbrows.ini
index a101b06..efe9e45 100644
--- a/iml_psql-dbrows.ini
+++ b/iml_psql-dbrows.ini
@@ -1,6 +1,6 @@
 ; ======================================================================
 ;
-;   PSQLSERVER activity
+; PSQLSERVER actions with db rows
 ;
 ; ----------------------------------------------------------------------
 ; 2023-06-08  <axel.hahn@unibe.ch>  initial version
@@ -32,16 +32,10 @@ title       = Read per sec
 [psqlserverdbrows.metrics_filters]
 returned  = "$service_name_template$.perfdata.tupreturned.value"
 fetched   = "$service_name_template$.perfdata.tupfetched.value"
-; inserted  = "$service_name_template$.perfdata.tupinserted.value"
-; updated   = "$service_name_template$.perfdata.tupupdated.value"
-; deleted   = "$service_name_template$.perfdata.tupdeleted.value"
 
 [psqlserverdbrows.functions]
 returned  = "alias($metric$, 'Returned rows (total)')"
 fetched   = "alias($metric$, 'Fetched - rows fetched by index scans')"
-; inserted  = "alias($metric$, 'inserted')"
-; updated   = "alias($metric$, 'updated')"
-; deleted   = "alias($metric$, 'deleted')"
 
 
 ; ----------------------------------------------------------------------
@@ -71,6 +65,3 @@ deleted   = "$service_name_template$.perfdata.tupdeleted.value"
 inserted  = "alias($metric$, 'inserted')"
 updated   = "alias($metric$, 'updated')"
 deleted   = "alias($metric$, 'deleted')"
-
-
-; ----------------------------------------------------------------------
diff --git a/iml_psql-diskblock.ini b/iml_psql-diskblock.ini
new file mode 100644
index 0000000..67f7f17
--- /dev/null
+++ b/iml_psql-diskblock.ini
@@ -0,0 +1,40 @@
+; ======================================================================
+;
+; PSQLSERVER actions with db rows
+;
+; ----------------------------------------------------------------------
+; 2023-06-09  <axel.hahn@unibe.ch>  initial version
+; ======================================================================
+
+
+; ----------------------------------------------------------------------
+; graph
+; ----------------------------------------------------------------------
+
+[psqlserverdisk.graph]
+check_command = "Postgres-diskblock"
+
+; blksread=0;; blkshit=470;;
+
+
+[psqlserverdisk.urlparams]
+areaAlpha   = "0.2"
+; areaMode    = "first"
+areaMode    = "all"
+colorList   = "cccccc,6699aa"
+;              ^      ^
+;              cache  read
+lineWidth   = "2"
+min         = "0"
+yUnitSystem = "binary"
+
+
+[psqlserverdisk.metrics_filters]
+hit   = "$service_name_template$.perfdata.blkshit.value"
+read  = "$service_name_template$.perfdata.blksread.value"
+
+
+[psqlserverdisk.functions]
+; usage = "alias(color($metric$, '#ff5566'), 'Usage (%)')"
+hit   = "alias($metric$, 'Hits from PostgreSQL buffer cache')"
+read  = "alias($metric$, 'Physical read disk blocks [per sec]')"
diff --git a/iml_psql-problems.ini b/iml_psql-problems.ini
new file mode 100644
index 0000000..680071f
--- /dev/null
+++ b/iml_psql-problems.ini
@@ -0,0 +1,68 @@
+; ======================================================================
+;
+; PSQLSERVER conflicts
+;
+; ----------------------------------------------------------------------
+; 2023-06-09  <axel.hahn@unibe.ch>  initial version
+; ======================================================================
+
+
+; ----------------------------------------------------------------------
+; graph
+; ----------------------------------------------------------------------
+
+[psqlserverproblems.graph]
+check_command = "Postgres-problems"
+
+; conflicts=0;; deadlocks=0;; checksumfailures=0;; tempfiles=0;; tempbytes=0;;
+
+[psqlserverproblems.urlparams]
+areaAlpha   = "0.2"
+areaMode    = "first"
+colorList   = "ee8822,ff4444,dd88dd,6699aa"
+;              ^      ^      ^      ^     
+;              confl. deadlk checks tmpfiles
+lineWidth   = "2"
+min         = "0"
+yUnitSystem = "binary"
+
+
+[psqlserverproblems.metrics_filters]
+conflicts        = "$service_name_template$.perfdata.conflicts.value"
+deadlocks        = "$service_name_template$.perfdata.deadlocks.value"
+checksumfailures = "$service_name_template$.perfdata.checksumfailures.value"
+tempfiles        = "$service_name_template$.perfdata.tempfiles.value"
+; tempbytes        = "$service_name_template$.perfdata.tempbytes.value"
+
+[psqlserverproblems.functions]
+conflicts        = "alias($metric$, 'conflicts - Number of queries canceled due to conflicts with recovery')"
+deadlocks        = "alias($metric$, '# of deadlocks')"
+checksumfailures = "alias($metric$, '# of data page checksum failures')"
+tempfiles        = "alias($metric$, 'Number of temporary files created by queries')"
+; tempbytes        = "alias($metric$, 'Total amount of data written to temporary files by queries')"
+
+; ----------------------------------------------------------------------
+; graph 2
+; ----------------------------------------------------------------------
+
+[psqlserverproblems2.graph]
+check_command = "Postgres-problems"
+
+; conflicts=0;; deadlocks=0;; checksumfailures=0;; tempfiles=0;; tempbytes=0;;
+
+[psqlserverproblems2.urlparams]
+areaAlpha   = "0.2"
+areaMode    = "first"
+colorList   = "6699aa"
+;              ^
+;              tmpbyte
+lineWidth   = "2"
+min         = "0"
+yUnitSystem = "binary"
+
+[psqlserverproblems2.metrics_filters]
+tempbytes        = "$service_name_template$.perfdata.tempbytes.value"
+
+[psqlserverproblems2.functions]
+tempbytes        = "alias($metric$, 'Total amount of data written to temporary files by queries')"
+
-- 
GitLab