check_nwc_health command for Icinga 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CheckCommand "nwc_health" { | |
import "plugin-check-command" | |
command = [ "/etc/icinga2/plugins/check_nwc_health" ] | |
arguments = { | |
"-H" = "$nwc_address$" | |
"--community" = "$snmp_community$" | |
"--protocol" = "$snmp_protocol$" | |
"--mode" = "$nwc_mode$" | |
"--warning" = "$nwc_warning$" | |
"--critical" = "$nwc_critical$" | |
"--name" = "$nwc_name$" | |
} | |
vars.snmp_community = "public" | |
vars.nwc_address = "$address$" | |
vars.nwc_timeout = 15 | |
vars.snmp_protocol = "2c" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Host "core-switch" { | |
import "generic-host" | |
address = "127.0.0.1" | |
vars.snmp_community = "mysecretpublic" | |
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" | |
} | |
} | |
apply Service "if-status" for (if_name => config in host.vars.interfaces) { | |
import "generic-service" | |
name = "interface " + if_name + " status" | |
notes = config.description | |
command = "nwc_health" | |
vars.nwc_mode = "interface-status" | |
vars.nwc_name = if_name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment