Hi, I want to monitor PostgreSQL log file as stated in title of this thread.
The problem is best described here:
in other words PostgreSQL relevant messages can be prefixed with "LOG:", but some irrelevant problems with select or connection problem can be prefixed with "ERROR:" or "FATAL:":
FATAL: no pg_hba.conf entry for host "X.X.X.X", user "zabbix_monitor", database "postgres", SSL off.
But I would only like to be alerted when real DBA relevant problems occur! My idea was to create item with this key:
which would only trigger a trigger when a text is found from first part of the regexp but not when the text from second part of this regexp is found.
The problem here is - the key length is limited to 256 characters?
How would you monitor PostgreSQL log file for relevant messages?
The problem is best described here:
in other words PostgreSQL relevant messages can be prefixed with "LOG:", but some irrelevant problems with select or connection problem can be prefixed with "ERROR:" or "FATAL:":
FATAL: no pg_hba.conf entry for host "X.X.X.X", user "zabbix_monitor", database "postgres", SSL off.
But I would only like to be alerted when real DBA relevant problems occur! My idea was to create item with this key:
Code:
log[/var/log/postgresql/postgresql-9.1-main.log," [I]^(?=.*?(ERROR|FATAL|PANIC|temporary file: path|SIGHUP|archive command failed|could not be archived|transaction ID wrap limit|must be vacuumed within|terminated|Segmentation fault|is missing)) ((?!syntax|unrecognized configuration parameter|parameter ".+" cannot be changed now|outside the valid range for parameter|out of range|canceling statement due to user request|cannot be matched|cannot drop|current transaction is aborted|relation ".+" already exists|returned record type does not match expected record type|at character|duplicate key|must not return|cannot cast|has no field|does not exist|value too long|must have an alias|must appear in the|constraint|temporary file|must be type|not allowed in|invalid regular expression|there is no parameter|IMMUTABLE|already exists).)*$[/I] "]
The problem here is - the key length is limited to 256 characters?
How would you monitor PostgreSQL log file for relevant messages?

Comment