My Icinga gives the following error on all switch ports that I have configured.
This is the host file:
object Host “SwitchPASDpto” {
import “generic-host”
import “int-ports-template”
address = “SwitchIP”
vars.snmp_v3 = true
vars.snmp_nocrypt = false
vars.snmp_address = “SwicthIP”
vars.snmp_port = 161
vars.snmp_login = “MyUser”
vars.snmp_password = “MyPass”
vars.snmp_v3_use_authprotocol = true
vars.snmp_authprotocol = “md5,des”
vars.snmp_v3_use_privpass = true
vars.snmp_privpass = “MyPass”
}
This is the template that gives the error:
template Host “int-ports-template” {
vars.snmp_interfaces[“snmp-int-port1”] = {
vars.snmp_interface = “Slot0/1”
vars.snmp_interface_label = “port1”
}
vars.snmp_interfaces[“snmp-int-port2”] = {
vars.snmp_interface = “Slot0/2”
vars.snmp_interface_label = “port2”
}
vars.snmp_interfaces[“snmp-int-port3”] = {
vars.snmp_interface = “Slot0/3”
vars.snmp_interface_label = “port 03”
}
vars.snmp_interfaces[“snmp-int-port4”] = {
vars.snmp_interface = “Slot0/4”
vars.snmp_interface_label = “port 04”
}
}
This is the service that gives the “ERROR : Unknown interface eth0”:
apply Service for (interface => config in host.vars.snmp_interfaces) {
import “generic-service”
display_name = "Network traffic on " + config.snmp_interface_label
check_command = “snmp-interface”
vars.snmp_interface_ifname = “true”
vars.snmp_interface_bits_bytes = “true”
vars.snmp_interface_megabytes = “true”
vars.snmp_interface_noregexp = “true”
vars.snmp_warncrit_percent = “true”
vars.snmp_warn = “100,100”
vars.snmp_crit = “100,100”
vars += config
assign where host.vars.snmp_address
}
This are the port names according to snmpwalk on that switch:
No matter what changes I make on the template I just get the same “ERROR : Unknown interface eth0”