Tried with the below in services.conf. We need to monitor the Interface-Usage of GigabitEthernet0/0/0 only & Interface-Status of all interfaces of a cisco ASR using “check_nwc”
apply Service “Interface-Usage” for (if_name => config in host.vars.interfaces){
import “service_check”
check_command = “check_nwc”
vars.nwc_mode = "interface-usage
vars.nwc_name = if_name
vars.nwc_warning = 80
vars.nwc_critical = 90
assign where “ASR” in host.groups && host.vars.interfaces == “GigabitEthernet0/0/0”
}
There are 8 interfaces in this device. I need to monitor all the interface-status. But need to monitor only the interface-usage of GigabitEthernet0/0/0. Tried the below. But I am getting the usage of all the 8 interfaces.
apply Service “Interface-Usage” for (if_name => config in host.vars.interfaces){
import “service_check”
check_command = “check_nwc”
vars.nwc_mode = “interface-usage”
vars.nwc_name = if_name
vars.nwc_warning = 80
vars.nwc_critical = 90
assign where “ASR” in host.groups && host.vars.interfaces[“GigabitEthernet0/0/0”]
}