Nagios - 主机和服务
Nagios 是用于监测 IT 基础架构中运行的主机和服务的颇受欢迎的工具。主机和服务配置是 Nagios Core 的基石。
主机就像计算机,可以是物理设备或虚拟设备。
服务是 Nagios 用来检查主机某些内容的工具。
可以在 Nagios 的服务器目录中创建主机文件,并注明主机和服务定义。例如 -
sudo gedit /usr/local/nagios/etc/servers/ubuntu_host.cfg
# Ubuntu 主机配置文件
define host {
use linux-server
host_name ubuntu_host
alias Ubuntu Host
address 192.168.1.10
register 1
}
define service {
host_name ubuntu_host
service_description PING
check_command check_ping!100.0,20%!500.0,60%
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
上述定义添加了一个名为 ubuntu_host 的主机,并定义了将在该主机上运行的服务。在重新启动 Nagios 时,将开始由 Nagios 监测此主机,并将运行指定的服务。
Nagios 中还有更多服务,可用于监测正在运行的主机上的几乎任何内容。
广告