[TNM] Tail_n_mail can not recognize a FATAL error in the logfiles
Kim Alex Olsen
kim.alex.olsen at regionh.dk
Tue Mar 24 15:15:51 UTC 2015
Hi
I can not get the tail_n_mail to work like expected.
I have this logfile :
-bash-4.1$ cat /data/postgresql93/pg_log/postgresql-Tue.log
< 2015-03-24 15:38:09.330 CET >FATAL: database "jjj" does not exist
< 2015-03-24 15:42:17.966 CET >FATAL: database "kim" does not exist
< 2015-03-24 15:42:28.727 CET >FATAL: role "kaos" does not exist
-bash-4.1$
This config file :
## Config file for the tail_n_mail program
## This file is automatically updated
## Last updated: Tue Mar 24 15:56:10 2015
EMAIL: kim.alex.olsen at regionh.dk
MAILSUBJECT: Acme HOST Postgres errors UNIQUE : NUMBER
INCLUDE: ERROR:
INCLUDE: FATAL:
INCLUDE: PANIC:
FILE1: /data/postgresql93/pg_log/postgresql-%a.log
LASTFILE1: /data/postgresql93/pg_log/postgresql-Fri.log
OFFSET1: 0
I expected a FATAl mail to appear but when I run it , it says this :
-bash-4.1$ perl tail_n_mail.pl tnm.config.txt --debug
Opened config file "tnm.config.txt"
$opt1 = {
'email' => [
'kim.alex.olsen at regionh.dk'
],
'configfile' => {
'email.kim.alex.olsen at regionh.dk' => 1,
'lastfile' => 1,
'file' => 1,
'include' => 1,
'customsubject' => 1,
'email' => 1,
'include.ERROR: ' => 1,
'mailsubject' => 1,
'include.PANIC: ' => 1,
'include.FATAL: ' => 1,
'file.HASH(0x26d3fa0)' => 1,
'offset' => 1
},
'lastfile' => {
'1' => '/data/postgresql93/pg_log/postgresql-Fri.log'
},
'mailsubject' => 'Acme HOST Postgres errors UNIQUE : NUMBER',
'file' => [
{
'lastfile' => '/data/postgresql93/pg_log/postgresql-Fri.log',
'original' => '/data/postgresql93/pg_log/postgresql-%a.log',
'suffix' => 1,
'name' => '/data/postgresql93/pg_log/postgresql-Tue.log',
'offset' => 0
}
],
'include' => [
'ERROR: ',
'FATAL: ',
'PANIC: '
],
'customsubject' => 1,
'offset' => {
'1' => '0'
}
};
$arg1 = {
'verbose' => 1,
'log_line_prefix' => '',
'mailserver' => 'example.com',
'find_line_number' => 1,
'file' => [],
'sortby' => 'count',
'maxsize' => 80000000,
'mailuser' => 'example',
'tsepnosub' => 0,
'debug' => 1,
'duration_limit' => 0,
'sqlstate' => 0,
'dryrun' => 0,
'timewarp' => 0,
'pgmode' => 1,
'nomail' => 0,
'duration' => -1,
'statement_size' => 1000,
'mailport' => 465,
'tsep' => undef,
'flatten' => 1,
'type' => 'normal',
'skip_non_parsed' => 0,
'smtp' => 0,
'tempfile_limit' => 0,
'tempfile' => -1,
'hideflatten' => 1,
'mailcom' => '/usr/sbin/sendmail',
'maxemailsize' => 10000000,
'reset' => 0,
'pretty_query' => 1,
'help' => 0,
'mailmode' => 'senddmail',
'mailpass' => 'example',
'offset' => -1,
'quiet' => 0,
'showonly' => 0,
'version' => 0,
'mailsig' => [],
'mailzero' => 0,
'rewind' => 0,
'pglog' => 'pg'
};
Log line prefix regex: (?-xism:^((\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \w\w\w\w?) \[(\d+)\])(.*))
Log line prefix regex2: (?-xism:^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \w\w\w\w? \[\d+\])
Log line prefix regex3: (?-xism:^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \w\w\w\w?)
Parsing file: /data/postgresql93/pg_log/postgresql-Fri.log
File: /data/postgresql93/pg_log/postgresql-Fri.log Offset: 0 Size: 0 Maxsize: 80,000,000
Checking for file /data/postgresql93/pg_log/postgresql-Tue.log (last was /data/postgresql93/pg_log/postgresql-Fri.log)
Checking for file /data/postgresql93/pg_log/postgresql-Mon.log (last was /data/postgresql93/pg_log/postgresql-Fri.log)
Checking for file /data/postgresql93/pg_log/postgresql-Sun.log (last was /data/postgresql93/pg_log/postgresql-Fri.log)
Checking for file /data/postgresql93/pg_log/postgresql-Sat.log (last was /data/postgresql93/pg_log/postgresql-Fri.log)
Parsing file: /data/postgresql93/pg_log/postgresql-Sat.log
File: /data/postgresql93/pg_log/postgresql-Sat.log Offset: 0 Size: 0 Maxsize: 80,000,000
Parsing file: /data/postgresql93/pg_log/postgresql-Sun.log
File: /data/postgresql93/pg_log/postgresql-Sun.log Offset: 0 Size: 0 Maxsize: 80,000,000
Parsing file: /data/postgresql93/pg_log/postgresql-Mon.log
File: /data/postgresql93/pg_log/postgresql-Mon.log Offset: 0 Size: 67 Maxsize: 80,000,000
Adding inclusion: ERROR:
Adding inclusion: FATAL:
Adding inclusion: PANIC:
Inclusion: (?-xism:ERROR: )|(?-xism:FATAL: )|(?-xism:PANIC: )
No new lines found in file /data/postgresql93/pg_log/postgresql-Mon.log
Parsing file: /data/postgresql93/pg_log/postgresql-Tue.log
File: /data/postgresql93/pg_log/postgresql-Tue.log Offset: 0 Size: 204 Maxsize: 80,000,000
No new lines found in file /data/postgresql93/pg_log/postgresql-Tue.log
Performing final cleanup
Saving new config file
It seems not to recognize the FATAL errors in the logfile.
Can someone help here ?
Best Regard
Kim Alex Olsen
________________________________
Denne e-mail indeholder fortrolig information. Hvis du ikke er den rette modtager af denne e-mail eller hvis du modtager den ved en fejltagelse, beder vi dig venligst informere afsender om fejlen ved at bruge svarfunktionen. Samtidig bedes du slette e-mailen med det samme uden at videresende eller kopiere den.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/tnm/attachments/20150324/59adc42c/attachment-0001.html>
More information about the TNM
mailing list