title: Monit on apache server : why monit log " 'apache' error -- unknown resource ID: [5]" on /var/log/monit
body: <p>We are monitoring several servers with Monit. We are using the version 5.25.1.
  Some are dedicated apache servers. The monitoring is ok.
  But the log of monit (/var/log/monit) is like this :</p>
  
  <pre><code>[CET Mar 18 03:12:03] info     : Starting Monit 5.25.1 daemon with http interface at [0.0.0.0]:3353
  [CET Mar 18 03:12:03] info     : Monit start delay set to 180s
  [CET Mar 18 03:15:03] info     : 'xxxxx.localhost' Monit 5.25.1 started
  [CET Mar 18 03:15:03] error    : 'apache' error -- unknown resource ID: [5]
  [CET Mar 18 03:16:08] error    : 'apache' error -- unknown resource ID: [5]
  [CET Mar 18 03:17:08] error    : 'apache' error -- unknown resource ID: [5]
  [CET Mar 18 03:18:08] error    : 'apache' error -- unknown resource ID: [5]
  </code></pre>
  
  <p>The configuration file /etc/monit.conf is like this : </p>
  
  <pre><code>###############################################################################
  ## Monit control file
  ###############################################################################
  
  ###############################################################################
  ## Global section
  ###############################################################################
  ##
  ## Start Monit in the background (run as a daemon):
  # check services at 2-minute intervals
  #     with start delay 240  # optional: delay the first check by 4-minutes (by
  #                           # default Monit check immediately after Monit start)
  
   set daemon 60
        with start delay 180
  
  ### Set the location of the Monit id file which stores the unique id for the
  ### Monit instance. The id is generated and stored on first Monit start. By
  ### default the file is placed in $HOME/.monit.id.
  #
   set idfile /var/.monit.id
  
  ## Set the list of mail servers for alert delivery. Multiple servers may be
  ## specified using a comma separator. By default Monit uses port 25 - it is
  ## possible to override this with the PORT option.
  #
  # set mailserver mail.bar.baz,               # primary mailserver
  #                backup.bar.baz port 10025,  # backup mailserver on port 10025
  #                localhost                   # fallback relay
  
  set mailserver localhost
  
  ## By default Monit will drop alert events if no mail servers are available.
  ## If you want to keep the alerts for later delivery retry, you can use the
  ## EVENTQUEUE statement. The base directory where undelivered alerts will be
  ## stored is specified by the BASEDIR option. You can limit the maximal queue
  ## size using the SLOTS option (if omitted, the queue is limited by space
  ## available in the back end filesystem).
  #
  set eventqueue
       basedir /var/monit  # set the base directory where events will be stored
       slots 100           # optionally limit the queue size
  
  ## Send status and events to M/Monit (for more informations about M/Monit
  ## see http://mmonit.com/).
  #
  # set mmonit http://monit:monit@192.168.1.10:8080/collector
  #
  #
  ## Monit by default uses the following alert mail format:
  ##
  ##
  ## You can override this message format or parts of it, such as subject
  ## or sender using the MAIL-FORMAT statement. Macros such as $DATE, etc.
  ## are expanded at runtime. For example, to override the sender, use:
  #
  # set mail-format { from: monit@foo.bar }
  #
  #
  ## You can set alert recipients whom will receive alerts if/when a
  ## service defined in this file has errors. Alerts may be restricted on
  ## events by using a filter as in the second example below.
  #
  
  set alert fake@mail.com not on { instance }
  
  # receive all alerts
  # set alert manager@foo.bar only on { timeout }  # receive just service-
  #                                                # timeout alert
  #
  
  mail-format {
        from: xxxxxxx@monit.localhost
     subject: $SERVICE =&gt; $EVENT
     message:
  DESCRIPTION : $DESCRIPTION
  ACTION      : $ACTION
  DATE        : $DATE
  HOST        : $HOST
  
  Sorry for the spam.
  Monit
  }
  
  
  ## Monit has an embedded web server which can be used to view status of
  ## services monitored and manage services from a web interface. See the
  ## Monit Wiki if you want to enable SSL for the web server.
  #
  set httpd port 3353 and
  use address 0.0.0.0
  allow yyyyy:zzzz
  
  ###############################################################################
  ## SeSTART rvices
  ###############################################################################
  ##
  ## Check general system resources such as load average, cpu and memory
  ## usage. Each test specifies a resource, conditions and the action to be
  ## performed should a test fail.
  #
  check system xxxxxx.localhost
      if loadavg (1min) &gt; 8 for 5 cycles then alert
      if loadavg (5min) &gt; 4 for 5 cycles then alert
      if memory usage &gt; 75% for 5 cycles then alert
      if cpu usage (user) &gt; 70% for 5 cycles then alert
      if cpu usage (system) &gt; 50% for 5 cycles then alert
      if cpu usage (wait) &gt; 50% for 5 cycles then alert
  
  check process apache with pidfile /var/run/httpd/httpd.pid
      group www
      start program = "/etc/init.d/httpd start" with timeout 60 seconds
      stop program  = "/etc/init.d/httpd stop"
      if failed host localhost port 80 then restart
      if cpu &gt; 60% for 2 cycles then alert
      if cpu &gt; 80% for 5 cycles then restart
      if loadavg(5min) greater than 10 for 8 cycles then restart
      if 3 restarts within 5 cycles then timeout    
  ###############################################################################
  ## Includes
  ###############################################################################
  ##
  ## It is possible to include additional configuration parts from other files or
  ## directories.
  #
  #  include /etc/monit.d/*
  #
  #
  
  # Include all files from /etc/monit.d/
  include /etc/monit.d/*
  </code></pre>
  
  <p>On ui monit, everything is ok. and the monitoring is 100% useful. We can stop, restart the service like we want.</p>
  
  <p>So I don't understand the sentence 'error    : 'apache' error -- unknown resource ID: [5]' we found on the log of monit.</p>
  
  <p>Anyone has an idea about it ?</p>
  
  <p>Thanks for your help.</p>