十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
cd /usr/local/nagios/etc/objects
vim localhost.cfg
define host{
use linux-server
host_name localhost
alias localhost
address 127.0.0.1
}
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}
# Define a service to "ftp" the local machine
define service{
use local-service ; Name of service template to use
host_name localhost
service_description FTP
check_command check_ftp
}
# Define a service to "nfs" the local machine
define service{
use local-service ; Name of service template to use
host_name localhost
service_description NFS
check_command check_tcp!2049
}
创新互联-专业网站定制、快速模板网站建设、高性价比富川网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式富川网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖富川地区。费用合理售后完善,10余年实体公司更值得信赖。
监控远程主机
==============================================================================
cd /usr/local/nagios/etc/objects
cp localhost.cfg 192.168.0.164.cfg
vim 192.168.122.100
define host{
use linux-server
host_name testserver
alias host196
address 192.168.122.100
}
#define hostgroup{
# hostgroup_name testserver ; The name of the hostgroup
# alias host; Long name of the group
# members localhost ; Comma separated list of hosts that belong to this group
#}
define service{
use local-service
host_name testserver
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service
host_name testserver
service_description HTTP
check_command check_http
# notifications_enabled 0
}
define service{
use local-service
host_name testserver
service_description NFS
check_command check_tcp!2049
# notifications_enabled 0
}
=============================================================================
更改主配置文件
vim /usr/local/nagios/etc/nagios.cfg
添加一行
cfg_file=/usr/local/nagios/etc/objects/192.168.122.100.cfg
检测新的配置文件是否正确
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
=============================================================================