From c9b2adaed676df3deb3ee1d2ead6a40e3296cdaa Mon Sep 17 00:00:00 2001 From: David Fuentes Date: Thu, 14 Dec 2023 15:35:39 +0100 Subject: [PATCH] Added 'MAIN.shm_records', 'MAIN.shm_flushes', 'MAIN.shm_cont' and 'MAIN.shm_cycles' --- CHANGELOG.txt | 3 ++ template-app-varnish-cache.j2 | 76 +++++++++++++++++++++++++++++++++++ zabbix-varnish-cache.py | 5 +++ 3 files changed, 84 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ce40306..5ebed1e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,6 @@ +- ?: + - Added 'MAIN.shm_records', 'MAIN.shm_flushes', 'MAIN.shm_cont' and 'MAIN.shm_cycles'. + - 25.0 (2023-11-03): - Fixed typo on 'MAIN.sc_rapid_reset' item name. diff --git a/template-app-varnish-cache.j2 b/template-app-varnish-cache.j2 index c5ef024..9a364e2 100644 --- a/template-app-varnish-cache.j2 +++ b/template-app-varnish-cache.j2 @@ -3379,6 +3379,82 @@ }, ], }, + { + 'id': 'item-prototype-1.159', + 'name': 'MAIN.shm_records (SHM records / sec)', + 'type': 'DEPENDENT', + 'key': 'varnish.stat["{#LOCATION_ID}","MAIN.shm_records"]', + 'value_type': 'FLOAT', + 'units': 'eps', + 'master_item_key': master, + 'preprocessing': [ + { + 'type': 'JSONPATH', + 'params': ['$[\'{#LOCATION_ID}.MAIN.shm_records\']'], + 'error_handler': 'DISCARD_VALUE', + }, + { + 'type': 'CHANGE_PER_SECOND', + }, + ], + }, + { + 'id': 'item-prototype-1.160', + 'name': 'MAIN.shm_flushes (SHM flushes due to overflow / sec)', + 'type': 'DEPENDENT', + 'key': 'varnish.stat["{#LOCATION_ID}","MAIN.shm_flushes"]', + 'value_type': 'FLOAT', + 'units': 'eps', + 'master_item_key': master, + 'preprocessing': [ + { + 'type': 'JSONPATH', + 'params': ['$[\'{#LOCATION_ID}.MAIN.shm_flushes\']'], + 'error_handler': 'DISCARD_VALUE', + }, + { + 'type': 'CHANGE_PER_SECOND', + }, + ], + }, + { + 'id': 'item-prototype-1.161', + 'name': 'MAIN.shm_cont (SHM lock contention / sec)', + 'type': 'DEPENDENT', + 'key': 'varnish.stat["{#LOCATION_ID}","MAIN.shm_cont"]', + 'value_type': 'FLOAT', + 'units': 'eps', + 'master_item_key': master, + 'preprocessing': [ + { + 'type': 'JSONPATH', + 'params': ['$[\'{#LOCATION_ID}.MAIN.shm_cont\']'], + 'error_handler': 'DISCARD_VALUE', + }, + { + 'type': 'CHANGE_PER_SECOND', + }, + ], + }, + { + 'id': 'item-prototype-1.162', + 'name': 'MAIN.shm_cycles (SHM cycles through VSL space / sec)', + 'type': 'DEPENDENT', + 'key': 'varnish.stat["{#LOCATION_ID}","MAIN.shm_cycles"]', + 'value_type': 'FLOAT', + 'units': 'eps', + 'master_item_key': master, + 'preprocessing': [ + { + 'type': 'JSONPATH', + 'params': ['$[\'{#LOCATION_ID}.MAIN.shm_cycles\']'], + 'error_handler': 'DISCARD_VALUE', + }, + { + 'type': 'CHANGE_PER_SECOND', + }, + ], + }, ], [ { diff --git a/zabbix-varnish-cache.py b/zabbix-varnish-cache.py index 1a0fa15..10698b0 100755 --- a/zabbix-varnish-cache.py +++ b/zabbix-varnish-cache.py @@ -182,6 +182,11 @@ r'MAIN\.ws_client_overflow', r'MAIN\.ws_session_overflow', r'MAIN\.ws_thread_overflow', + # SHM: activity. + r'MAIN\.shm_records', + r'MAIN\.shm_flushes', + r'MAIN\.shm_cont', + r'MAIN\.shm_cycles', # VHA6. r'KVSTORE\.vha6_stats\..+\.(?:broadcast_candidates|broadcast_nocache|broadcast_skip|broadcast_lowttl|broadcast_toolarge|broadcasts|fetch_self|fetch_peer|fetch_peer_hit|fetch_origin|fetch_origin_deliver|fetch_peer_insert|error_version_mismatch|error_no_token|error_bad_token|error_stale_token|error_rate_limited|error_fetch|error_fetch_insert|error_fetch_seal|error_localhost|error_origin_mismatch|error_origin_miss|error_max_broadcasts|error_fetch_self|legacy_vha)', # KVStore-based counters.