@@ -106,19 +106,22 @@ def macros(self, template, dashboard=False):
106106 return []
107107
108108 def triggers (self , template , dashboard = False ):
109- result = template .trigger ({
110- "name" : "PostgreSQL Health: service has been restarted on {HOSTNAME} (uptime={ITEM.LASTVALUE})" ,
111- "expression" : "{#TEMPLATE:" + self .right_type (self .key_uptime ) + ".change()}>" +
112- self .plugin_macros ["pg_uptime" ][0 ][1 ]
113- }) + template .trigger ({
114- "name" : "PostgreSQL Health: cache hit ratio too low on {HOSTNAME} ({ITEM.LASTVALUE})" ,
115- "expression" : "{#TEMPLATE:" + self .right_type (self .key_cache , "hit" ) + ".last()}<" +
116- self .plugin_macros ["cache_hit_ratio_percent" ][0 ][1 ]
117- }) + template .trigger ({
118- "name" : "PostgreSQL Health: no ping from PostgreSQL for 3 minutes on {HOSTNAME}" ,
119- "expression" : "{#TEMPLATE:" + self .right_type (self .key_ping ) + ".nodata(180)}=1"
120- })
121- return result
109+ if self .Type == 'mamonsu' :
110+ result = template .trigger ({
111+ "name" : "PostgreSQL Health: service has been restarted on {HOSTNAME} (uptime={ITEM.LASTVALUE})" ,
112+ "expression" : "{#TEMPLATE:" + self .right_type (self .key_uptime ) + ".change()}>" +
113+ self .plugin_macros ["pg_uptime" ][0 ][1 ]
114+ }) + template .trigger ({
115+ "name" : "PostgreSQL Health: cache hit ratio too low on {HOSTNAME} ({ITEM.LASTVALUE})" ,
116+ "expression" : "{#TEMPLATE:" + self .right_type (self .key_cache , "hit" ) + ".last()}<" +
117+ self .plugin_macros ["cache_hit_ratio_percent" ][0 ][1 ]
118+ }) + template .trigger ({
119+ "name" : "PostgreSQL Health: no ping from PostgreSQL for 3 minutes on {HOSTNAME}" ,
120+ "expression" : "{#TEMPLATE:" + self .right_type (self .key_ping ) + ".nodata(180)}=1"
121+ })
122+ return result
123+ else :
124+ return ""
122125
123126 def keys_and_queries (self , template_zabbix ):
124127 # TODO: define another metric key because it duplicates native zabbix agents keys
0 commit comments