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!

  • 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.

  • 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.