网络主机监控-nagios应用漫谈(六)

配置linux主机监控

Vi /usr/local/nagios/etc/nagios.cfg  //增加监控linux配置文件 

cfg_file=/usr/local/nagios/etc/objects/mylinux.cfg

Vi /usr/local/nagios/etc/object/mylinux.cfg

define host{

use linux-server,host-pnp ; Inherit default values from a template

host_name server112 ; The name we're giving to this server

alias 10.21.26.144 ; A longer name for the server

Address50.22.77.4 ; IP address of the server

}

define service{

        use                             generic-service

        host_name                  mylinux

        service_description             PING

        check_command                   check_ping!100.0,20%!300.0,60%

        }

define service{

        use                             generic-service

        host_name                  mylinux

        service_description             HTTP

        check_command                   check_http

        }

define service{

        use                             generic-service

        host_name                  mylinux

        service_description             FTP

        normal_check_interval           1

        check_command                   check_ftp

        }

define service{

use generic-service

host_name mylinux

service_description check_load

check_command check_nrpe!check_load

}

define service{

use generic-service

host_name mylinux

service_description check_swap

check_command check_nrpe!check_swap

}

define service{

use generic-service

host_name mylinux

service_description check-disk

check_command check_nrpe!check_had1

}

Chown nagios:nagios mylinux.cfg   //更改所属组

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Service nagios restart

http://192.168.213.134/nagios

你可能感兴趣的:(nagios,服务器监控,nagios监控)