Compare commits
No commits in common. "af3bbf75151ea565225eac06b6465f8bece65938" and "f716569aa72dd84d0342decc7b05ff5232a2fdf8" have entirely different histories.
af3bbf7515
...
f716569aa7
14
src/pgmon.py
14
src/pgmon.py
@ -27,7 +27,7 @@ from urllib.parse import urlparse, parse_qs
|
||||
import requests
|
||||
import re
|
||||
|
||||
VERSION = "1.0.3"
|
||||
VERSION = "1.0.2"
|
||||
|
||||
# Configuration
|
||||
config = {}
|
||||
@ -699,18 +699,6 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
if metric_name == "agent_version":
|
||||
self._reply(200, VERSION)
|
||||
return
|
||||
elif metric_name == "latest_version_info":
|
||||
try:
|
||||
get_latest_version()
|
||||
self._reply(
|
||||
200,
|
||||
json.dumps(
|
||||
{"latest": latest_version, "supported": 1 if release_supported else 0}
|
||||
),
|
||||
)
|
||||
except LatestVersionCheckError as e:
|
||||
log.error("Failed to retrieve latest version information: {}".format(e))
|
||||
self._reply(503, "Failed to retrieve latest version info")
|
||||
|
||||
# Note: parse_qs returns the values as a list. Since we always expect
|
||||
# single values, just grab the first from each.
|
||||
|
||||
@ -11,39 +11,6 @@ zabbix_export:
|
||||
groups:
|
||||
- name: 'My Templates'
|
||||
items:
|
||||
- uuid: de1fa757395440118026f4c7a7c4ebbe
|
||||
name: 'PostgreSQL latest supported version'
|
||||
type: DEPENDENT
|
||||
key: pgmon.release.latest
|
||||
delay: '0'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.latest
|
||||
master_item:
|
||||
key: 'pgmon[latest_version_info]'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- uuid: e1a003317bc043908ee0803704a6e1d0
|
||||
name: 'PostgreSQL release support status'
|
||||
type: DEPENDENT
|
||||
key: pgmon.release.supported
|
||||
delay: '0'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.supported
|
||||
master_item:
|
||||
key: 'pgmon[latest_version_info]'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
triggers:
|
||||
- uuid: 88eac74402d64e7cb853e8cb505b1939
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.supported)<>1'
|
||||
name: 'PostgreSQL major release is lo longer supported'
|
||||
priority: INFO
|
||||
- uuid: 763920af8da84db8a9a2667d9653cb21
|
||||
name: 'PostgreSQL Agent Version'
|
||||
type: HTTP_AGENT
|
||||
@ -57,19 +24,6 @@ zabbix_export:
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- uuid: d890e395fbbc4f2bacbd50e7321fcb9f
|
||||
name: 'PostgreSQL latest version info'
|
||||
type: HTTP_AGENT
|
||||
key: 'pgmon[latest_version_info]'
|
||||
delay: 12h
|
||||
history: '0'
|
||||
value_type: TEXT
|
||||
trends: '0'
|
||||
description: 'Information about the latest PostgreSQL version in the current series'
|
||||
url: 'http://localhost:{$AGENT_PORT}/version'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- uuid: 8706eccb7edc4fa394f552fc31f401a9
|
||||
name: 'Max Frozen XID Age'
|
||||
type: HTTP_AGENT
|
||||
@ -957,35 +911,6 @@ zabbix_export:
|
||||
path: $.repid
|
||||
- lld_macro: '{#STATE}'
|
||||
path: $.state
|
||||
- uuid: e22315b0295d4b43aa6b6611ede13e84
|
||||
name: 'Discover Replication Slots'
|
||||
type: HTTP_AGENT
|
||||
key: pgmon_discover_slots
|
||||
delay: 10m
|
||||
item_prototypes:
|
||||
- uuid: a9f53efdce0a4bdc970925f8588e01c5
|
||||
name: 'Replication Slot Stats for {#SLOT_NAME}'
|
||||
type: HTTP_AGENT
|
||||
key: 'pgmon_slot_stats[{#SLOT_NAME}]'
|
||||
history: '0'
|
||||
value_type: TEXT
|
||||
trends: '0'
|
||||
url: 'http://localhost:{$AGENT_PORT}/slot_stats'
|
||||
query_fields:
|
||||
- name: slot
|
||||
value: '{#SLOT_NAME}'
|
||||
url: 'http://localhost:{$AGENT_PORT}/discover_slots'
|
||||
lld_macro_paths:
|
||||
- lld_macro: '{#ACTIVE}'
|
||||
path: $.active
|
||||
- lld_macro: '{#DATABASE}'
|
||||
path: $.database
|
||||
- lld_macro: '{#PLUGIN}'
|
||||
path: $.plugin
|
||||
- lld_macro: '{#SLOT_NAME}'
|
||||
path: $.slot_name
|
||||
- lld_macro: '{#TEMPORARY}'
|
||||
path: $.temporary
|
||||
macros:
|
||||
- macro: '{$AGENT_PORT}'
|
||||
value: '5400'
|
||||
@ -1063,22 +988,3 @@ zabbix_export:
|
||||
- type: STRING
|
||||
name: reference
|
||||
value: XSCMZ
|
||||
triggers:
|
||||
- uuid: 94ce93c828aa46b4bd4f3732fc7090c6
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.latest) - last(/PostgreSQL by pgmon/pgmon[version]) >= 1'
|
||||
name: 'PostgreSQL is at least 1 version behind'
|
||||
priority: INFO
|
||||
dependencies:
|
||||
- name: 'PostgreSQL is at least 2 version behind'
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.latest) - last(/PostgreSQL by pgmon/pgmon[version]) >= 2'
|
||||
- uuid: 2701bcd1223c4ee787f3eca30288e6c6
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.latest) - last(/PostgreSQL by pgmon/pgmon[version]) >= 2'
|
||||
name: 'PostgreSQL is at least 2 version behind'
|
||||
priority: INFO
|
||||
dependencies:
|
||||
- name: 'PostgreSQL is at least 3 version behind'
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.latest) - last(/PostgreSQL by pgmon/pgmon[version]) >= 3'
|
||||
- uuid: 3c9adbe8b6f84b3788c6a3e513075df5
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon.release.latest) - last(/PostgreSQL by pgmon/pgmon[version]) >= 3'
|
||||
name: 'PostgreSQL is at least 3 version behind'
|
||||
priority: INFO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user