我是新来的nagios和我的服务器是在一个networking,不允许服务器被ping通。 是否有可能检查服务器是否是另一种方式? 例如通过SSH或HTTP? 我如何做到这一点,所以我的nagios报告,它不会显示在线时,服务器脱机?
在主机定义上,您可以指定要使用的命令。
define host{ use generic-host host_name SVR_1 alias SVR_1 address 10.0.0.6 check_command check-host-alive max_check_attempts 2 notification_interval 120 notification_period 24x7 notification_options d,u,r }
所以,通常在checkcommands.cfg中,你可以用你想要的来创build一个新的命令,或者你可以使用check_http。
define command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1 }
您可能已将您的服务器configuration为hosts.cfg中的主机,其外观如下所示
check_command check-host-alive
check-host-alive在commands.cfg中定义为使用check_ping。
我build议你把check_command改成my-check-host-alive之类的东西,然后在commands.cfg中定义my-check-host-alive来使用类似check_tcp的东西。
用-h启动check_tcp来查看它的帮助。
使用不同的设备状态检查,默认情况下,它使用主机活动检查,使用check_nrpe或者testing它。
结帐Centreon,应该简化你的nagiosconfiguration。