@@ -28,7 +28,7 @@ class Oldest(Plugin):
28
28
29
29
DEFAULT_CONFIG = {
30
30
'max_xid_age' : str (5000 * 60 * 60 ),
31
- 'max_query_time ' : str (5 * 60 * 60 )
31
+ 'max_transaction_time ' : str (5 * 60 * 60 )
32
32
}
33
33
34
34
def run (self , zbx ):
@@ -40,13 +40,13 @@ def run(self, zbx):
40
40
query = Pooler .query (self .OldestQuerySql )[0 ][0 ]
41
41
42
42
zbx .send ('pgsql.oldest[xid_age]' , xid )
43
- zbx .send ('pgsql.oldest[query_time ]' , query )
43
+ zbx .send ('pgsql.oldest[transaction_time ]' , query )
44
44
45
45
def graphs (self , template ):
46
46
result = template .graph ({
47
- 'name' : 'PostgreSQL oldest query running time' ,
47
+ 'name' : 'PostgreSQL oldest transaction running time' ,
48
48
'items' : [{
49
- 'key' : 'pgsql.oldest[query_time ]' ,
49
+ 'key' : 'pgsql.oldest[transaction_time ]' ,
50
50
'color' : '00CC00'
51
51
}]
52
52
})
@@ -65,8 +65,8 @@ def items(self, template):
65
65
'name' : 'PostgreSQL: age of oldest xid' ,
66
66
'value_type' : Plugin .VALUE_TYPE .numeric_unsigned
67
67
}) + template .item ({
68
- 'key' : 'pgsql.oldest[query_time ]' ,
69
- 'name' : 'PostgreSQL: oldest query running time in sec' ,
68
+ 'key' : 'pgsql.oldest[transaction_time ]' ,
69
+ 'name' : 'PostgreSQL: oldest transaction running time in sec' ,
70
70
'units' : Plugin .UNITS .s
71
71
})
72
72
@@ -76,7 +76,7 @@ def triggers(self, template):
76
76
'expression' : '{#TEMPLATE:pgsql.oldest[xid_age]'
77
77
'.last()}>' + self .plugin_config ('max_xid_age' )
78
78
}) + template .trigger ({
79
- 'name' : 'PostgreSQL query running is too old on {HOSTNAME}' ,
80
- 'expression' : '{#TEMPLATE:pgsql.oldest[query_time ]'
81
- '.last()}>' + self .plugin_config ('max_query_time ' )
79
+ 'name' : 'PostgreSQL transaction running is too old on {HOSTNAME}' ,
80
+ 'expression' : '{#TEMPLATE:pgsql.oldest[transaction_time ]'
81
+ '.last()}>' + self .plugin_config ('max_transaction_time ' )
82
82
})
0 commit comments