title: How do I use Nagios to monitor a log file
body: <p>We are using Nagios to monitor our network with great success. However, we have a syslog for critical application errors and while I set up check_log, it doesn't seem to work as well as monitering a device.</p>
  
  <p>The issues are:</p>
  
  <ul>
  <li>It only shows the last entry</li>
  <li>There doesn't seem to be a way to acknowledge the critical error and
  return the monitor to a good state</li>
  </ul>
  
  <p>Is nagios the wrong tool, or are we just not setting up the service monitering right?</p>
  
  <p>Here are my entries</p>
  
  <pre><code># log file
  define command{
          command_name    check_log
          command_line    $USER1$/check_log -F /var/log/applications/appcrit.log -O /tmp/appcrit.log -q ?
  }
  
  
  # Define the log monitering service
  define service{
          name                            logfile-check           ;
          use                             generic-service         ;
          check_period                    24x7                    ;
          max_check_attempts              1                       ;
          normal_check_interval           5                       ;
          retry_check_interval            1                       ;
          contact_groups                  admins                  ;
          notification_options            w,u,c,r                 ;
          notification_period             24x7                    ;
          register                        0                       ;
          }
  
  define service{
          use                             logfile-check
          host_name                       localhost
          service_description             CritLogFile
          check_command                   check_log
  }
  </code></pre>