[root@test ~]# cat /usr/local/nagios/etc/services/192.168.0.103.cfg
define host{
use linux-server,host-pnp
host_name test
alias test
address 192.168.0.103
}
define service{
use generic-service,service-pnp
host_name test
service_description check_ping
check_command check_ping!100.0,20%!200.0,50%
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Root Partition
check_command check_local_disk!20%!10%!/
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description check_ssh
check_command check_ssh
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Swap Usage
check_command check_local_swap!20!10
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Total Processes
check_command check_local_procs!544!744!RSZDT
max_check_attempts 5
normal_check_interval 1
}
#define hostgroup{
# hostgroup_name client ; The name of the hostgroup
# alias client ; Long name of the group
# members test ; Comma separated list of hosts that belong to this group
# }
[root@test ~]#
define host{
use linux-server,host-pnp
host_name test
alias test
address 192.168.0.103
}
define service{
use generic-service,service-pnp
host_name test
service_description check_ping
check_command check_ping!100.0,20%!200.0,50%
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Root Partition
check_command check_local_disk!20%!10%!/
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description check_ssh
check_command check_ssh
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Swap Usage
check_command check_local_swap!20!10
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,service-pnp
host_name test
service_description Total Processes
check_command check_local_procs!544!744!RSZDT
max_check_attempts 5
normal_check_interval 1
}
#define hostgroup{
# hostgroup_name client ; The name of the hostgroup
# alias client ; Long name of the group
# members test ; Comma separated list of hosts that belong to this group
# }
[root@test ~]#
本文详细介绍了如何在服务器上配置主机和监控服务,包括使用Nagios进行服务监控的相关配置,涉及Ping检查、磁盘空间监控、SSH状态检查、交换分区使用率监控和进程数量监控。
2118

被折叠的 条评论
为什么被折叠?



