q528 发表于 2015-11-23 07:16:53

nagios如何监控tomcat以及apache状态

  http://www.linuxtone.org/html/90/t-3690.html
  监控tomcat
define service{
      normal_check_interval         1
      use                                 generic-service
      host_name                     localhost
      service_description          check_tomcat_8080
      check_command               check_tcp!8080
      }

监控apache
define service{
      normal_check_interval         1
      notification_period         check-time
      use                                  generic-service
      host_name                     locahost
      service_description          check_http
      check_command               check_http!80
  
  -----------
  下面就可以在services.cfg中定义对apache主机磁盘容量的监控
define service{
      host_name            apache
被监控的主机名,这里注意必须是linux且运行着nrpe,而且必须是hosts.cfg中定义的
      service_description   check-disk
      监控项目的名称
      check_command         check_nrpe!check_disk
       监控命令是check_nrpe,是在commands.cfg中定义的,带的参数是check_disk,是在nrpe.cfg中定义的
      max_check_attempts      5
      normal_check_interval   3
      retry_check_interval    2
      check_period            24x7
      notification_interval   10
      notification_period   24x7
      notification_options    w,u,c,r
      contact_groups          sagroup
      }
像这样将其余几个监控项目加进来.
页: [1]
查看完整版本: nagios如何监控tomcat以及apache状态