I’m trying yet another approach to try and get something usable.
I’ve now moved over to check_snmp_int.pl
however I’m trying to get the -down
command line argument to work. It seems to be missing from the command when imported into Director.
object CheckCommand "snmp-interface" {
import "plugin-check-command"
command = [ PluginDir + "/check_snmp_int.pl" ]
timeout = 1m
arguments += {
"--64bits" = {
description = "Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps"
set_if = "$snmp_interface_64bit$"
}
"--label" = {
description = "Add label before speed in output : in=, out=, errors-out=, etc..."
value = "$snmp_interface_label$"
}
"-2" = {
description = "Use snmp v2c"
set_if = "$snmp_v2$"
}
"-A" = {
set_if = "$snmp_interface_ifalias$"
}
"-B" = {
description = "Make the warning and critical levels in K|M|G Bits/s instead of K|M|G Bytes/s"
set_if = "$snmp_interface_kbits$"
}
"-C" = {
description = "Community name for the host's SNMP agent (implies v1 protocol)"
set_if = "$snmp_nocrypt$"
value = "$snmp_community$"
}
"-H" = {
description = "Name or IP address of host to check"
value = "$snmp_address$"
}
"-L" = {
description = "<authproto>,<privproto> - <Authentication protocol (md5|sha : default md5)>,<Priv protocole (des|aes : default des)>"
set_if = "$snmp_v3_use_authprotocol$"
value = "$snmp_authprotocol$"
}
"-M" = {
description = "Make the warning and critical levels in Mbps"
set_if = "$snmp_interface_megabytes$"
}
"-N" = {
set_if = "$snmp_interface_ifname$"
}
"-W" = {
description = "Include 'weathermap' data for NagVis in performance data"
set_if = "$snmp_interface_weathermap$"
}
"-X" = {
description = "Priv password for snmpv3 (AuthPriv protocol)"
set_if = "$snmp_v3_use_privpass$"
value = "$snmp_privpass$"
}
"-Y" = {
description = "Output performance data in bits/s or Bytes/s"
set_if = "$snmp_interface_bits_bytes$"
}
"-c" = "$snmp_crit$"
"-d" = {
description = "Make an average of <delta> seconds (default 300=5min)"
value = "$snmp_interface_delta$"
}
"-e" = {
description = "Add error & discard to Perfparse output"
set_if = "$snmp_interface_errors$"
}
"-f" = {
description = "Perfparse compatible output (no output when interface is down)"
set_if = "$snmp_perf$"
}
"-i" = {
description = "Make critical when up"
set_if = "$snmp_interface_inverse$"
}
"-k" = {
description = "Check the input/ouput bandwidth of the interface"
set_if = "$snmp_interface_perf$"
}
"-l" = {
description = "Login and auth password for snmpv3 authentication"
set_if = "$snmp_v3$"
value = "$snmp_login$"
}
"-n" = {
description = "Name in description OID (eth0, ppp0 ...). This is treated as a regexp : -n eth will match eth0,eth1,..."
value = "$snmp_interface$"
}
"-p" = {
description = "SNMP port (Default 161)"
value = "$snmp_port$"
}
"-r" = {
description = "Do not use regexp to match NAME in description OID"
set_if = "$snmp_interface_noregexp$"
}
"-t" = {
description = "Timeout for SNMP in seconds (Default: 5)"
value = "$snmp_timeout$"
}
"-u" = {
description = "Make the warning and critical levels in % of reported interface speed"
set_if = "$snmp_interface_warncrit_percent$"
}
"-w" = "$snmp_warn$"
"-x" = {
description = "Priv password"
set_if = "$snmp_v3$"
value = "$snmp_password$"
}
"-y" = {
description = "Output performance data in % of max speed"
set_if = "$snmp_interface_percent$"
}
}
vars.check_address = {
arguments = [ ]
deprecated = false
name = "<anonymous>"
side_effect_free = false
type = "Function"
}
vars.check_ipv4 = false
vars.check_ipv6 = false
vars.snmp_address = "$check_address$"
vars.snmp_authprotocol = "md5,des"
vars.snmp_community = "public"
vars.snmp_crit = "0,600"
vars.snmp_interface = "eth0"
vars.snmp_interface_64bit = false
vars.snmp_interface_bits_bytes = true
vars.snmp_interface_delta = 300
vars.snmp_interface_errors = true
vars.snmp_interface_ifalias = false
vars.snmp_interface_ifname = false
vars.snmp_interface_kbits = true
vars.snmp_interface_megabytes = true
vars.snmp_interface_noregexp = false
vars.snmp_interface_percent = false
vars.snmp_interface_perf = true
vars.snmp_interface_warncrit_percent = false
vars.snmp_login = "snmpuser"
vars.snmp_nocrypt = true
vars.snmp_perf = true
vars.snmp_timeout = "5"
vars.snmp_v2 = false
vars.snmp_v3 = false
vars.snmp_v3_use_authprotocol = false
vars.snmp_v3_use_privpass = false
vars.snmp_warn = "300,400"
}
I’m trying to add the option, as I don’t want to flag down interfaces as critical.
I can’t seem to find a way of simply adding the flag to the existing imported command. So I’ve tried to clone the command. To the most part this has worked, however the resulting service refuses to recognize the target host, even though it’s there.
object CheckCommand "snmp-interface_v3" {
import "plugin-check-command"
command = [ PluginDir + "/check_snmp_int.pl" ]
timeout = 1m
arguments += {
"--64bits" = {
description = "Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps"
set_if = "$snmp_interface_64bit$"
}
"--down" = {
set_if = "$interfaces_down_is_ok$"
}
"--label" = {
description = "Add label before speed in output : in=, out=, errors-out=, etc..."
value = "$snmp_interface_label$"
}
"-2" = {
description = "Use snmp v2c"
set_if = "$snmp_v2$"
}
"-A" = {
set_if = "$snmp_interface_ifalias$"
}
"-B" = {
description = "Make the warning and critical levels in K|M|G Bits/s instead of K|M|G Bytes/s"
set_if = "$snmp_interface_kbits$"
}
"-C" = {
description = "Community name for the host's SNMP agent (implies v1 protocol)"
set_if = "$snmp_nocrypt$"
value = "$snmp_community$"
}
"-H" = {
description = "Name or IP address of host to check"
value = "$snmp_address$"
}
"-L" = {
description = "<authproto>,<privproto> - <Authentication protocol (md5|sha : default md5)>,<Priv protocole (des|aes : default des)>"
set_if = "$snmp_v3_use_authprotocol$"
value = "$snmp_authprotocol$"
}
"-M" = {
description = "Make the warning and critical levels in Mbps"
set_if = "$snmp_interface_megabytes$"
}
"-N" = {
set_if = "$snmp_interface_ifname$"
}
"-W" = {
description = "Include 'weathermap' data for NagVis in performance data"
set_if = "$snmp_interface_weathermap$"
}
"-X" = {
description = "Priv password for snmpv3 (AuthPriv protocol)"
set_if = "$snmp_v3_use_privpass$"
value = "$snmp_privpass$"
}
"-Y" = {
description = "Output performance data in bits/s or Bytes/s"
set_if = "$snmp_interface_bits_bytes$"
}
"-c" = "$snmp_crit$"
"-d" = {
description = "Make an average of <delta> seconds (default 300=5min)"
value = "$snmp_interface_delta$"
}
"-e" = {
description = "Add error & discard to Perfparse output"
set_if = "$snmp_interface_errors$"
}
"-f" = {
description = "Perfparse compatible output (no output when interface is down)"
set_if = "$snmp_perf$"
}
"-i" = {
description = "Make critical when up"
set_if = "$snmp_interface_inverse$"
}
"-k" = {
description = "Check the input/ouput bandwidth of the interface"
set_if = "$snmp_interface_perf$"
}
"-l" = {
description = "Login and auth password for snmpv3 authentication"
set_if = "$snmp_v3$"
value = "$snmp_login$"
}
"-n" = {
description = "Name in description OID (eth0, ppp0 ...). This is treated as a regexp : -n eth will match eth0,eth1,..."
value = "$snmp_interface$"
}
"-p" = {
description = "SNMP port (Default 161)"
value = "$snmp_port$"
}
"-r" = {
description = "Do not use regexp to match NAME in description OID"
set_if = "$snmp_interface_noregexp$"
}
"-t" = {
description = "Timeout for SNMP in seconds (Default: 5)"
value = "$snmp_timeout$"
}
"-u" = {
description = "Make the warning and critical levels in % of reported interface speed"
set_if = "$snmp_interface_warncrit_percent$"
}
"-w" = "$snmp_warn$"
"-x" = {
description = "Priv password"
set_if = "$snmp_v3$"
value = "$snmp_password$"
}
"-y" = {
description = "Output performance data in % of max speed"
set_if = "$snmp_interface_percent$"
}
}
vars.check_address = {
arguments = [ ]
deprecated = false
name = "<anonymous>"
side_effect_free = false
type = "Function"
}
vars.check_ipv4 = false
vars.check_ipv6 = false
vars.snmp_address = "$check_address$"
vars.snmp_authprotocol = "md5,des"
vars.snmp_community = "public"
vars.snmp_crit = "0,600"
vars.snmp_interface = "eth0"
vars.snmp_interface_64bit = false
vars.snmp_interface_bits_bytes = true
vars.snmp_interface_delta = 300
vars.snmp_interface_errors = true
vars.snmp_interface_ifalias = false
vars.snmp_interface_ifname = false
vars.snmp_interface_kbits = true
vars.snmp_interface_megabytes = true
vars.snmp_interface_noregexp = false
vars.snmp_interface_percent = false
vars.snmp_interface_perf = true
vars.snmp_interface_warncrit_percent = false
vars.snmp_login = "snmpuser"
vars.snmp_nocrypt = true
vars.snmp_perf = true
vars.snmp_timeout = "5"
vars.snmp_v2 = false
vars.snmp_v3 = false
vars.snmp_v3_use_authprotocol = false
vars.snmp_v3_use_privpass = false
vars.snmp_warn = "300,400"
}
Could someone offer advice on how to add —down to the already imported command or what’s happening with my duplicated service?
thanks