From kaushalshriyan at gmail.com Thu Dec 8 11:01:50 2016 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Thu, 8 Dec 2016 15:31:50 +0530 Subject: [monitoring-users] check_logfiles returns OK inspite of Error in the log file Message-ID: Hi, I have gone through the document labs.consol.de/nagios/check_logfiles/index.html. I am running the below command /usr/lib/nagios/plugins/check_logfiles --logfile=/opt/tomcat_gnip/logs/hashapi/gnipclienttest.log --criticalpattern "Error message received as stream result. Quitting connection" OK - no errors or warnings|default_lines=0 default_warnings=0 default_criticals=0 default_unknowns=0 cat /opt/tomcat_gnip/logs/hashapi/gnipclienttest.log [ERROR] 2016-11-24 04:02:49.176 [pool-4-thread-1] GnipClientLog - Error message received as stream result. Quitting connection. [ERROR] 2016-12-01 00:54:18.541 [pool-4-thread-1] GnipClientLog - Error message received as stream result. Quitting connection. I am not sure why the command returns OK inspite of having Error in the /opt/tomcat_gnip/logs/hashapi/gnipclienttest.log file /usr/lib/nagios/plugins/check_logfiles --version check_logfiles v3.7.6.3 /usr/lib/nagios/plugins/check_logfiles Usage: check_logfiles [-t timeout] -f [--searches=tag1,tag2,...] check_logfiles [-t timeout] --logfile= --tag= --rotation= --criticalpattern= --warningpattern= /usr/lib/nagios/plugins/check_logfiles --help This Nagios Plugin comes with absolutely NO WARRANTY. You may use it on your own risk! Copyright by ConSol Software GmbH, Gerhard Lausser. This plugin looks for patterns in logfiles, even in those who were rotated since the last run of this plugin. You can find the complete documentation at labs.consol.de/nagios/check_logfiles/ Usage: check_logfiles [-t timeout] -f The configfile looks like this: $seekfilesdir = '/opt/nagios/var/tmp'; # where the state information will be saved. $protocolsdir = '/opt/nagios/var/tmp'; # where protocols with found patterns will be stored. $scriptpath = '/opt/nagios/var/tmp'; # where scripts will be searched for. $MACROS = { CL_DISK01 => "/dev/dsk/c0d1", CL_DISK02 => "/dev/dsk/c0d2" }; @searches = ( { tag => 'temperature', logfile => '/var/adm/syslog/syslog.log', rotation => 'bmwhpux', criticalpatterns => ['OVERTEMP_EMERG', 'Power supply failed'], warningpatterns => ['OVERTEMP_CRIT', 'Corrected ECC Error'], options => 'script,protocol,nocount', script => 'sendnsca_cmd' }, { tag => 'scsi', logfile => '/var/adm/messages', rotation => 'solaris', criticalpatterns => 'Sense Key: Not Ready', criticalexceptions => 'Sense Key: Not Ready /dev/testdisk', options => 'noprotocol' }, { tag => 'logins', logfile => '/var/adm/messages', rotation => 'solaris', criticalpatterns => ['illegal key', 'read error.*$CL_DISK01$'], criticalthreshold => 4 warningpatterns => ['read error.*$CL_DISK02$'], } ); I will appreciate if anyone can help me understand what is going wrong in my above command line. Please share me some working examples to understand more about the usage of check_logfiles nagios plugin. Thanks in Advance. Regards, Kaushal -------------- next part -------------- An HTML attachment was scrubbed... URL: