SNMP OK - down​(2) cannot change to SNMP CRITICAL - *down(2)*​

This forum was archived to /woltlab and is now in read-only mode.
  • Dear all,


    I configure icinga to monitor port mikrotik by use snmp,


    SNMP OK - down(2) cannot change to SNMP CRITICAL - *down(2)*


    when i use command it work but icinga cannot change from OK to CRITICAL


    ./check_snmp -H 192.168.189.55 -C NOC. -o .1.3.6.1.2.1.2.2.1.8.1 -r 1
    SNMP CRITICAL - *2* | iso.3.6.1.2.1.2.2.1.8.1=2


    How to change from OK to CRITICAL in incinag?


    vars.oids["oper-status"] = [".1.3.6.1.2.1.2.2.1.8.1"," -r 1"]


    vars.oids["oper-status"] = ["ifOperStatus.1"]



    please help me

    The post was edited 4 times, last by mom ().

  • Please attach the service definition.

    Please provide more details of your configuration.
    If you want me to help you please read what i wrote.



    still not work!!

    I need MORE information about YOUR setup to help you.

  • sorry later reply,


    my configure here



    ==============================
    object Host "MIKROTIK1" {
    import "generic-host"
    address = "192.168.189.55"
    vars.os = "RouterOS"
    vars.snmp_community = "NOC."
    vars.notification["mail"] = {
    groups = [ "icingaadmins" ]
    }
    vars.oids["if01"] =[ ".1.3.6.1.2.1.2.2.1.2.1"," -r 1"]
    /*vars.oids["oper-status"] = [".1.3.6.1.2.1.2.2.1.8.1"," -r 1"]*/
    vars.oids["oper-status"] = ".1.3.6.1.2.1.2.2.1.8.1"


    vars.oids["oper-status"] = {
    snmp_oid = "ifOperStatus.1"
    snmp_ereg = 1
    }



    }



    apply Service for (identifier => oid in host.vars.oids) {
    check_command = "snmp"
    display_name = identifier
    vars.snmp_oid = oid
    vars.snmp_community = "NOC."
    enable_active_checks = true
    max_check_attempts = "10"
    check_interval = 1m
    retry_interval = 1m
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = true
    enable_event_handler = true
    enable_perfdata = true
    volatile = false
    assign where host.name == "MIKROTIK1"
    }


    please check and thanks

  • At first you dont have to redefine the snmp community on the service.


    vars.snmp_community = "NOC."

    For max_check_attempts you dont need to use quotation marks for the numbers

    max_check_attempts = "10"

    For the service i would recommend to create a template for different attributes:


    enable_active_checks = true


    Next what do you want to do with this statement ?

    vars.snmp_oid = oid


    I would do it like this:


    Host:


    Service:


  • Hi Dear,
    i follow your sample and got problem below, please help check


    /etc/icinga2/conf.d/services.conf(17): vars += config

  • hello


    when i put configure bellow


    vars += config


    i got error bellow
    /etc/icinga2/conf.d/services.conf(17): vars += config



    please help me

  • Hello guys,


    Is there anyway that we setup "SNMP - CRITICAL" in RED COLOR for a particular service when value changes from 0 to 1. I did make a script to say it is critical for change in value but it shows as still OK and in green color.




  • Luckystrings ,


    Please don't revive threads from a year ago.


    Regarding your issue, you need to configure warning/critical thresholds for your check to display red in Icinga.


    If you're using check_snmp, simply add a '-w' or '-c' argument with the value set to the threshold you need.


    There's plenty of documentation for this, but you can make a new thread if necessary.