Good day
I need some help here as we can not seem to figure this one out.
We recently upgraded icinga from 2.4 to version 2.10.
However after the upgrade, some of the time specific monitors no longer work and we can not seem to figure out why this is happening.
One of the processes in short needs to pass different parameters to the check based on the time of day due to the system being busier during the day than during the evenings.
Currently the check is setup as follows :
Service Defiinition:
apply Service "Asterisk - Time Since Last Pcap" {
# import "generic-service"
import "voice-service"
check_command = "nrpe"
vars.nrpe_command = "check_last_pcap"
if (host.vars.env == "dev") {
vars.nrpe_arguments = [ "999999 999999" ]
} else if (get_time_period("EightToEight5Days").is_inside) {
vars.nrpe_arguments = [ "10800 14400" ]
}
assign where host.vars.type == "voice-worker"
}
This was changed yesterday as follows as part of testing the service in order to find the problem:
if (host.vars.env == "dev") {
vars.nrpe_arguments = [ "999999 999999" ]
} else { vars.nrpe_arguments = {{
if (get_time_period("EightToEight5Days").is_inside) {
return [ "10800 14400" ] }
}}
}
However, the check is still passing the incorrect parameters during the evening.
I would really appreciate it if someone can guide us in order to figure out what needs to be changed to get this working again.