Hi, everyone,
I am new to Icinga, I have added a switch to Icinga and now trying to display the interface status on web UI using the nwc_health plugin but I am failing to display it in the proper form
Command.conf file
object CheckCommand “check_nwc_health” {
import “plugin-check-command”
command = [ PluginDir + “/check_nwc_health” ]
arguments = {
“–hostname” = “$nwc_address$”
“–port” = “$nwc_port$”
“-t” = “$nwc_timeout$”
“–timeout” = “$nwc_timeout$”
“–protocol” = “$snmp_protocol$”
“–community” = “$snmp_community$”
“–mode” = “$nwc_mode$”
“–name” = “$nwc_name$”
“–warning” = “$nwc_warning$”
“–critical” = “$nwc_critical$”
/* “–name” = {
value = “–name $avm_device_name$”
description = “Switch 001”
}*/
}
vars.nwc_address = “$address$”
vars.nwc_port = “161”
vars.snmp_community = “public”
vars.nwc_snmpversion = “2c”
vars.nwc_timeout = “30”
}
service.conf
apply Service for (interface => config in host.vars.snmp_interfaces) {
import “generic-service”
display_name = "Network traffic for " + config.vars.snmp_interface
check_command = “check_nwc_health”
vars.snmp_interface = config.vars.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 = “70,80”
vars.snmp_crit = “80,100”
vars += config
assign where host.vars.os_type == “switch”
}
template.conf
template Host “int-ports-template” {
vars.snmp_interfaces[“snmp-int-port1”] = {
snmp_interface = “1”
snmp_interface_label = “port 01”
grafana_graph_disable = true
}
vars.snmp_interfaces[“snmp-int-port2”] = {
snmp_interface = “2”
snmp_interface_label = “port 02”
grafana_graph_disable = true
}
vars.snmp_interfaces[“snmp-int-port3”] = {
snmp_interface = “3”
snmp_interface_label = “port 03”
grafana_graph_disable = true
}
vars.snmp_interfaces[“snmp-int-port4”] = {
snmp_interface = “4”
snmp_interface_label = “port 04”
grafana_graph_disable = true
}
vars.snmp_interfaces[“snmp-int-port4”] = {
snmp_interface = “4”
snmp_interface_label = “port 04”
grafana_graph_disable = true
}
check_command =“hostalive”
vars.agent_type =“snmp”
vars.snmp_community=“My Secret Key”
}
Host.conf
object Host “Switch-100.2” {
import “generic-host”
import “int-ports-template”
address = “my IP”
/* vars.interfaces[“GigabitEthernet0/1”] = {
description = “Management”
}
vars.interfaces[“GigabitEthernet0/2”] = {
description = “Uplink 1”
}
vars.interfaces[“GigabitEthernet0/3”] = {
description = “Uplink 2”
}
vars.interfaces[“Port-Channel1”] = {
description = “Main Uplink”
}*/
vars.snmp_community = “my secret key”
vars.nwc_mode = “interface-status”
vars.os_type = “switch”
vars.nwc_consumption_warning = “80”
vars.nwc_consumption_critical = “95”
vars.agent_type = “snmp”
}
error is