Icinga2 - Host details
2016-09-17 03:45:35 0 举报
Easy to understand flowchart about how to add services check, from an host point of view. This is what could have save me hours of testing, digging and experiments :)
作者其他创作
大纲/内容
/etc/icinga2/conf.d/services.conf
object Host \"Freebox\" {
object CheckCommand \"dhcp2\" { import \"plugin-check-command\" command = [ PluginDir + \"/check_dhcp\" ] arguments = { \"-s\" = \"$dhcp_serverip$\" \"-r\" = \"$dhcp_requestedip$\" \"-t\" = \"$dhcp_timeout$\" \"-i\" = \"$dhcp_interface$\" \"-m\" = \"$dhcp_mac$\" \"-u\" = { set_if = \"$dhcp_unicast$\" } } vars.dhcp_unicast = false vars.dhcp_serverip = \"192.168.1.254\" }
/usr/share/icinga2/include/command-plugins.conf
apply Service \"DHCP Check\" { import \"generic-service\" check_command = \"dhcp2\" assign where host.vars.type == \"router\" }
Related code in the file
/usr/lib/nagios/plugins/check_dummy
object CheckCommand \"dhcp2\" {
command = [ PluginDir + \"/check_dhcp\" ]
assign where host.vars.type == \"router\"
vars.type = \"router\"
PluginDir + \"/check_dummy\
template Host \"noping\" { max_check_attempts = 3 check_interval = 1m retry_interval = 30s check_command = \"dummy\" } template Service \"generic-service\" { max_check_attempts = 5 check_interval = 1m retry_interval = 30s }
/etc/icinga2/conf.d/templates.conf
apply Service \"DHCP Check\" {
check_command = \"dhcp2\"
object CheckCommand \"dummy\" {
import \"generic-service\"
Files
template Host \"noping\" {
template Service \"generic-service\" {
/usr/lib/nagios/plugins/check_dhcp
/usr/share/icinga2/include/command-plugins.confThis config file must not be modified !So I created custom-commands.conf :)
/etc/icinga2/conf.d/custom-commands.conf
import \"noping\"
check_command = \"dummy\"
HOST
address = \"192.168.1.254\"
0 条评论
下一页