Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #12838] snmp_miblist variable to feed the -m option of check_snmp is missing in the snmpv3 CheckCommand object #4710

Closed
icinga-migration opened this issue Oct 1, 2016 · 4 comments
Labels
area/itl Template Library CheckCommands bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12838

Created by peckel on 2016-10-01 18:04:05 +00:00

Assignee: peckel
Status: Resolved (closed on 2016-10-11 10:44:49 +00:00)
Target Version: 2.6.0
Last Update: 2016-10-11 10:44:49 +00:00 (in Redmine)

Icinga Version: 2.5.4
Backport?: Not yet backported
Include in Changelog: 1

While the snmp_miblist variable can be used to feed the -m option to the check_snmp command in the snmp CheckCommand object, there is no analogous snmpv3_miblist in the snmpv3 CheckCommand object:

object CheckCommand "snmp" {
    import "plugin-check-command"

    command = [ PluginDir + "/check_snmp" ]

    arguments = {
        "-H" = "$snmp_address$"
        "-o" = "$snmp_oid$"
        "-C" = "$snmp_community$"
        "-c" = "$snmp_crit$"
        "-w" = "$snmp_warn$"
        "-s" = "$snmp_string$"
        "-r" = "$snmp_ereg$"
        "-R" = "$snmp_eregi$"
        "-l" = "$snmp_label$"
        "-u" = "$snmp_units$"
        "-t" = "$snmp_timeout$"
        "-p" = "$snmp_port$"
        "-e" = "$snmp_retries$"
        "--invert-search" = {
            set_if = "$snmp_invert_search$"
            description = "Invert search result and return CRITICAL if found"
        }
        "-P" = "$snmp_version$"
        "-m" = "$snmp_miblist$"
        "--rate-multiplier" = "$snmp_rate_multiplier$"
        "--rate" = {
            set_if = "$snmp_rate$"
            description = "Enable rate calculation"
        }
        "-n" = {
            set_if = "$snmp_getnext$"
            description = "Use SNMP GETNEXT instead of SNMP GET"
        }
    }

    vars.snmp_address = {{
        var addr_v4 = macro("$address$")
        var addr_v6 = macro("$address6$")

        if (addr_v4) {
            return addr_v4
        } else {
            return "udp6:[" + addr_v6 + "]"
        }
    }}

    vars.snmp_community = "public"
    vars.snmp_invert_search = false
    vars.snmp_timeout = "10"
}

object CheckCommand "snmpv3" {
    import "plugin-check-command"
    import "ipv4-or-ipv6"

    command = [ PluginDir + "/check_snmp" ]

    arguments = {
        "-H" = {
                value = "$snmpv3_address$"
                description = "Host name, IP Address, or unix socket (must be an absolute path)"
        }
        "-n" = {
                set_if = "$snmpv3_getnext$"
                description = "Use SNMP GETNEXT instead of SNMP GET"
        }
        "-P" = {
                value = 3
                description = "SNMP protocol version"
        }
        "-L" = {
                value = "$snmpv3_seclevel$"
                description = "SNMPv3 securityLevel"
        }
        "-a" = {
                value = "$snmpv3_auth_alg$"
                description = "SNMPv3 auth proto"
        }
        "-U" = {
                value = "$snmpv3_user$"
                description = "SNMPv3 username"
        }
        "-A" = {
                value = "$snmpv3_auth_key$"
                description = "SNMPv3 authentication password"
        }
        "-X" = {
                value = "$snmpv3_priv_key$"
                description = "SNMPv3 privacy password"
        }
        "-o" = {
                value = "$snmpv3_oid$"
                description = "Object identifier(s) or SNMP variables whose value you wish to query"
        }
        "-x" = {
                value = "$snmpv3_priv_alg$"
                description = "SNMPv3 priv proto (default DES)"
        }
        "-w" = {
                value = "$snmpv3_warn$"
                description = "Warning threshold range(s)"
        }
        "-c" = {
                value = "$snmpv3_crit$"
                description = "Critical threshold range(s)"
        }
        "-s" = {
                value = "$snmpv3_string$"
                description = "Return OK state (for that OID) if STRING is an exact match"
        }
        "-r" = {
                value = "$snmpv3_ereg$"
                description = "Return OK state (for that OID) if extended regular expression REGEX matches"
        }
        "-R" = {
                value = "$snmpv3_eregi$"
                description = "Return OK state (for that OID) if case-insensitive extended REGEX matches"
        }
        "--invert-search" = {
                set_if = "$snmpv3_invert_search$"
                description = "Invert search result and return CRITICAL if found"
        }
        "-l" = {
                value = "$snmpv3_label$"
                description = "Prefix label for output from plugin"
        }
        "-u" = "$snmpv3_units$"
        "--rate-multiplier" = "$snmpv3_rate_multiplier$"
        "--rate" = {
            set_if = "$snmpv3_rate$"
            description = "Enable rate calculation"
        }
        "-t" = "$snmpv3_timeout$"
    }

    vars.snmpv3_address = "$check_address$"
    vars.snmpv3_auth_alg = "SHA"
    vars.snmpv3_priv_alg = "AES"
    vars.snmpv3_seclevel = "authPriv"
    vars.snmpv3_timeout = "10"
}

Does this have a reason I just can't see, or was it an oversight?

On second look, snmpv3_port is missing as well.

Attachments

Changesets

2016-10-11 10:42:54 +00:00 by (unknown) d1f5118

Add missing '-m' (snmpv3_miblist) and -p (snmpv3_port) options

The options for setting an explicit MIB list and for specifying the target
port that are present for the snmp CheckCommand object that were missing from
the snmpv3 CheckCommand object are added with this patch.

fixes #12838

Signed-off-by: Gunnar Beutner <gunnar.beutner@icinga.com>

2016-10-11 10:43:33 +00:00 by gbeutner fc34afb

Fix indentation for the snmpv3 check command definition

refs #12838

2016-10-11 10:44:34 +00:00 by gbeutner 616bcd1

Update AUTHORS

refs #12838

2016-10-14 13:54:34 +00:00 by (unknown) 8e0ed5e

Add missing '-m' (snmpv3_miblist) and -p (snmpv3_port) options

The options for setting an explicit MIB list and for specifying the target
port that are present for the snmp CheckCommand object that were missing from
the snmpv3 CheckCommand object are added with this patch.

fixes #12838

Signed-off-by: Gunnar Beutner <gunnar.beutner@icinga.com>

2016-10-14 13:54:34 +00:00 by gbeutner b4b6e81

Fix indentation for the snmpv3 check command definition

refs #12838

2016-10-14 13:54:34 +00:00 by gbeutner a80334b

Update AUTHORS

refs #12838
@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-10-04 07:28:12 +00:00

  • Category changed from Plugins to ITL

Must be an oversight I guess. Feel free to provide a patch. :)

@icinga-migration
Copy link
Author

Updated by peckel on 2016-10-04 08:01:55 +00:00

  • File added 0001-Added-missing-m-snmpv3_miblist-and-p-snmpv3_port-opt.patch

Hi Gunnar,

here you go ...

Best regards,

Peter.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-10-11 10:44:19 +00:00

  • Status changed from New to Assigned
  • Assigned to set to peckel
  • Target Version set to 2.6.0

Fixed indentation and merged. Thanks. :)

@icinga-migration
Copy link
Author

Updated by Anonymous on 2016-10-11 10:44:49 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset d1f5118.

@icinga-migration icinga-migration added bug Something isn't working area/itl Template Library CheckCommands labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.6.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant