Error: "Can't mix snmp v1, 2c, 3 protocols!" using snmp v3 with snmp-memory


    • Error: "Can't mix snmp v1, 2c, 3 protocols!" using snmp v3 with snmp-memory\


    • This command:


    • check_snmp_mem.pl -v -H kvm.lala.bo -l bravo -x th3r4m1N+ -X j4bAdeHu5 -w 50,70 -c 80,90


      works perfectly but my host config file containing the below



      object Host "kvm.lala.bo" {


      check_command = "snmp-memory"


      host_name = "kvm.lala.bo"


      vars.snmp_v3 = "true"


      vars.snmp_warn = "50,70"


      vars.snmp_crit = "80,90"


      vars.snmp_perf = "true"


      vars.snmp_login = "bravo"


      vars.snmp_password = "th3r4m1N+


      vars.snmp_v3_use_privpass = "true"


      vars.snmp_privpass = "j4bAdeHu5"

      }


      fails completely with error: Can't mix snmp v1, 2c, 3 protocols!

  • Can you please extract the executed command line? I do not have the url at hand, but it should be found on the troubleshooting docs.

  • I doubt the command has ever been run. At least I can't recall if it has.
    In Icinga2 I would simply edit commands.cfg and prepend $USER1$/capture_plugin.pl to the command and then tail the /tmp/captured_plugins.log file.

  • The output is probably from Icinga Web 2, so it has been run somewhere, and should be logged. You can easily turn on the debug log, force a new check either via web or API action and then look what's being executed.

  • Yes, I see this error in the icingaweb interface. I'm starting/running Icinga in the foreground icinga2 daemon -x notice so maybe I'll see something.

  • OK. I finally was able to run this check manually. Seems to work well.
    /usr/lib64/nagios/plugins/check_snmp_mem.pl -v -H kvm -l bravo -x baB3lf1Sh -X j1bBr3rJ4br -w 70,75 -c 80,85


    Alarm at 15

    SNMPv3 AuthPriv login : bravo, md5, des
    Ram : 6349692 (832860 cached, 48584 buff) / 8174076 : 12
    Swap : 8384508 / 8384508 : 0
    Ram : 12%, Swap : 0% : ; OK

  • Adopting your CLI-Command then ...

    Code
    1. vars.snmp_v3 = true //make it a boolean
    2. vars.snmp_warn = "70.75"
    3. vars.snmp_crit = "80,85"
    4. vars.snmp_perf = true //make it a boolean
    5. vars.snmp_login = "bravo"
    6. vars.snmp_password = "baB3lf1Sh"
    7. vars.snmp_v3_use_privpass = true //make it a boolean
    8. vars.snmp_privpass = "j1bBr3rJ4br"

    Btw - vars.snmp_perf = true is set by default.

  • Director renders the below as a sample, or something. So do we paste this into a file and modify it to fit our needs?
    If so, what file might that be? If I wanted all my target hosts to be monitored using snmp v3, should I make it a service template perhaps?


  • check_snmp_mem.pl is part of the Manubulon plugins package, and there are existing CheckCommand definitions found inside the ITL. I would just use those and let the Director kickstart import them. Yours looks like a custom handmade CheckCommand just for your use case, not sure if that works out.

  • Hi dnsmichi, I'm having the same issue and I'm couldn't solve it.

    Here's my configuration and the outputs.


    Host definition:

    Code
    1. object Host "PBX Testing" {
    2. import "generic-host"
    3. address = "10.64.12.140"
    4. vars.notification["mail"] = {
    5. groups = [ "nivel dos" ]
    6. }
    7. }


    Service definition:


    Command line plugin output:

    Code
    1. # /usr/lib/nagios/plugins/check_snmp_load.pl -H 10.64.12.140 -l MonTel -x 1234567890 -T netsc -w 50 -c 80 -v
    2. Alarm at 15 + 5
    3. SNMPv3 login
    4. SNMPv3 AuthNoPriv login : MonTel, md5
    5. Checking OID : 1.3.6.1.4.1.2021.11.11.0
    6. OID returned 98
    7. CPU used 2.0% (<50) : OK


    IcingaWeb2 plugin output

    Code
    1. Plugin Output
    2. Can't mix snmp v1, 2c, 3 protocols!
    3. Usage: /usr/lib/nagios/plugins/check_snmp_load.pl [-v] -H <host> -C <snmp_community> [-2] (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> -T


    Snmpwalk output

    Code
    1. # snmpwalk -u MonTel -A 1234567890 -a MD5 -l authnoPriv 10.64.12.140 1.3.6.1.4.1.2021.11.11.0
    2. iso.3.6.1.4.1.2021.11.11.0 = INTEGER: 98