Configuring Logrobot in nagios (if using the Nagios NRPE agent or our custom logXray agent)

 

If using NRPE:

 

  • Your command definition in the commands.cfg file on the Nagios Monitoring server will look similar to this:

 

define command {
       command_name    nrpe_args
       command_line       $USER1$/check_nrpe -t 20 -n -u -H
$HOSTNAME$ -c $ARG1$ -a $ARG2$
}

 

 

OR

 

 

define command {
       command_name    nrpe_args
       command_line       $USER1$/check_nrpe -t 20 -n -u -H
$HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

 

 

  • Any log check service you define in the services.cfg, on the Nagios Monitoring server, will look similar to this:

 

 

define service {

check_command             nrpe_args!logxray!'localhost /var/tmp/logXray autonda /opt/apps/alert.log 60m 'ERROR' '.' 5 5 tomcat_logchk -ndshow'
service_description          PLM LogCheck - Tomcat
notifications_enabled       0
max_check_attempts       1
check_interval                300
contact_groups               retail-group
host_name                     monitor-01.logrobot.com,monitor-02.logrobot.com,monitor-03.logrobot.com

use                               unix_service

}
 

 

  • The definition for the logxray script in the nrpe.cfg file on the monitored hosts will look similar to this:

 

 

command[logxray]=/usr/lib64/nagios/plugins/logxray $ARG1$

 

 

If using the custom logXray agent:

 

  • Your commands.cfg file will look similar to this:

 

define command {
         command_name    NLM
         command_line      $USER1$/nlm $ARG1$
$HOSTNAME$ $ARG2$ $ARG3$ $ARG4$ "$ARG5$" "$ARG6$" $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$
}

 

 

OR

 

 

define command {
         command_name    NLM
         command_line      $USER1$/nlm $ARG1$
$HOSTADDRESS$ $ARG2$ $ARG3$ $ARG4$ "$ARG5$" "$ARG6$" $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$
}

 

 

  • Your services.cfg will contain something similar to this:

 

define service {
         check_command                         NLM!llogxray!/var/tmp/logXray!autonda!/var/log/proteus.log!15m!500.html!500 Internal Server Error!1!2!500_Errors!-ndshow
         max_check_attempts                  1
         service_description                     500_ERRORS_LOGCHECK
         host_name                                logxray-01.com,logxray-02.com,logxray-03.com
         use                                          five-minute-interval
 }
 


 

Sample Screenshot:

 

Screenshot of a similar but different setup: