Monitor the Size of Multiple Log Files
How to Monitor and Alert on the Size of Multiple log files
The following command will alert if files are found with size greater than zero.
[root@nagios-primary ~]# ./logrobot localhost /var/tmp/logXray autodoc /var/mqm/errors,.FDC,12m 0B 0B filesize
CRITICAL: File [ /var/mqm/errors,.FDC,12m ]. Current Size = [ /var/mqm/errors/AMQ24835.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24834.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24821.0.FDC(repeat),81673(bytes),11 /var/mqm/errors/AMQ24832.0.FDC(repeat),26973(bytes),11 /var/mqm/errors/AMQ24827.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24826.0.FDC(repeat),26973(bytes),11 /var/mqm/errors/AMQ24833.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24828.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24836.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24825.0.FDC(repeat),26973(bytes),11 /var/mqm/errors/AMQ24831.0.FDC(repeat),26973(bytes),11 /var/mqm/errors/AMQ24830.0.FDC(repeat),27053(bytes),11 /var/mqm/errors/AMQ24829.0.FDC(repeat),27053(bytes),11 ]. Thresholds: [ W=0B ] and [ C=0B ].
[root@nagios001 ~]# ./logrobot localhost /var/tmp/logXray autodoc /apps/scope/GAP/wmswave/cbs/logs/cores,1,*,1440m 0B 0B filesize
OK: File [ /apps/scope/GAP/wmswave/cbs/logs/cores,1,*,1440m ]. Current Size = [ no_problem_files_detected ]. Thresholds: [ W=0B ] and [ C=0B ].
[root@nagios001 ~]# ./logrobot localhost /var/tmp/logXray autodoc /apps/scope/GAP/wmswave/cbs/logs/cores,1,*,1440m 0B 0B filesize
CRITICAL: File [ /apps/scope/GAP/wmswave/cbs/logs/cores,1,*,1440m ]. Current Size = [ /apps/scope/GAP/wmswave/cbs/logs/cores/PkShipWaveS/core.10114,533901312(bytes),3m ]. Thresholds: [ W=0B ] and [ C=0B ].
Next time check runs, you'll see the word 'repeat' next to each file that has already been reported/alerted on
CRITICAL: File [ /apps/scope/GAP/wmswave/cbs/logs/cores,1,*,1440m ]. Current Size = [ /apps/scope/GAP/wmswave/cbs/logs/cores/PkShipWaveS/core.12263(repeat),592871424(bytes),7m ]. Thresholds: [ W=0B ] and [ C=0B ].
[root@nagios001 ~]# ./logrobot localhost /var/tmp/logXray autonda /wms/prod/*/data/download_files/Rcv*.out 30m 'nothing-to-search-for' '.' 1 1 MultiLogGrowthChk -ndfoundn
(OR)
[root@nagios001 ~]# ./logrobot localhost /var/tmp/logXray autonda /wms/prod/_ast_/data/download_files/Rcv_ast_.out 30m 'nothing-to-search-for' '.' 1 1 MultiLogGrowthChk -ndfoundn
Log File Content
Scan content of log files for new occurrences (or lack thereof) of specific keywords, strings or patterns.
Log File Size
Monitor the sizes of single or multiple log files - alert if log size breaches predefined thresholds.
Log File Growth
Monitor the growth of single or multiple log files - alert when the monitored logs stop receiving new data.
Log File Timestamp
Monitor the timestamp of single or multiple logs. Alert, if logs are older than X amount of minutes or hours.