Hello, I am trying to create a command for chrony check (check_ntp), for that I go to Icinga Director and create the command like this:
CheckCommand object "check_chrony" {
import "plugin-check-command"
command = [PluginDir + "/check_chrony.sh"]
arguments + = {
"-c" = {
order = 4
required = true
value = "$ ntp_critical $"
}
"-w" = {
order = 2
skip_key = true
value = "$ ntp_warning $"
}
}
}
The service template defined it like this:
template Service "check_chrony_svc" {
import "director-generic-service"
check_command = "check_chrony"
check_period = "Always"
command_endpoint = host_name
}
I added it under host templates later.
I am having two themes to use it:
1 - I am getting an alert with âInfo: Error: Non-optional macro ântp_criticalâ used in argument â-câ is missing.â From here I cannot realize what I am doing wrong, nor do I understand well where to take the variables ântp_criticalâ and ântp_warningâ that have the same name as those of a check_ntp_time that I used without defining anything, it was already in "external commands "
2 - After defining a variable in Icinga Director - Define Data Fields, I cannot see it to use it in âService apply rulesâ, in this case it is a âusing_chronyâ variable, to identify the hosts that use chrony instead of ntpd.
I appreciate the help you can give me either by guiding me or by indicating where I find the documentation to understand that since I have been reading something but I am confused.