lausser / check_logfiles

A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) which scans logfiles for patterns.
https://omd.consol.de/docs/plugins/check_logfiles/
GNU General Public License v2.0
46 stars 27 forks source link

logfilemissing=critical only working in commandline not in config #52

Open rmorandell-pgum opened 4 years ago

rmorandell-pgum commented 4 years ago

Hi,

i'm using check_logfiles v3.11 and I would like to use the logfilemissing option in the config. If i'm using it in the config its working fine

/usr/lib/nagios/plugins/check_logfiles --logfile /var/log/sgv/cmdbsync.log --logfilemissing critical

CRITICAL - (1 errors in check_logfiles.protocol-2020-05-22-15-20-08) - could not find logfile /var/log/sgv/cmdbsync.log |'default_lines'=0 'default_warnings'=0 'default_criticals'=1 'default_unknowns'=0

When i'm using the config is doesn't have no effects and returns UKNOWN and not CRITICAL

/usr/lib/nagios/plugins/check_logfiles -f /etc/sgv/check_logfiles_cmdbsync.conf

UNKNOWN - (1 unknown in check_logfiles_cmdbsync.protocol-2020-05-22-15-21-41) - could not find logfile /var/log/sgv/cmdbsync.log |'default_lines'=0 'default_warnings'=0 'default_criticals'=0 'default_unknowns'=1

Here the very simple config

$MACROS = {
        LOGFILE => '/var/log/sgv/cmdbsync.log'
};

@searches = (
{
        logfile => '$LOGFILE$',
        logfilemissing => 'critical'
});

Any idea ?

Thanks for your help

Kind regards