Re: check_logfiles Problem
Posted: Mon Jun 29, 2015 6:09 am
Here is the result of applying the command 3 times:
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=27979 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=28033 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=28053 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$
It is working fine, what we want is to set the reading log file from the offset, the file we monitor is related to the date ( `date +%Y%m%d`-Actions.log) , when error occurred the error messages received during all the day until new logfile created by means that the reading is always start from the begging not from the offset.
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=27979 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=28033 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$ ./check_nrpe -H Charging-OP -c check_logfiles -a "--logfile=D:\\TopupServiceLogs\\`date +%Y%m%d`-Actions.log --rotation=\d{2}\d{2}\d{2}-Actions.log --criticalpattern=ERROR --noprotocol --criticalthreshold=1 --type=virtual"
OK - no errors or warnings|default_lines=28053 default_warnings=0 default_criticals=0 default_unknowns=0
[nagios@nms libexec]$
It is working fine, what we want is to set the reading log file from the offset, the file we monitor is related to the date ( `date +%Y%m%d`-Actions.log) , when error occurred the error messages received during all the day until new logfile created by means that the reading is always start from the begging not from the offset.