Set SNMP time out


(Arethusa) #1

Hello,

In certain case, my Icinga2 server have some time out from snmp (check_snmp).

So, I want to set the snmp time out, but I don’t know how to set it.

If you can help me.

Thank you !


(Michael Friedrich) #2

Hi,

please follow the FAQ and provide as much detail as possible to fully understand your problem. This includes installed software versions, your current configuration snippets, and plugin/shell outputs. Literally anything you can think of one would need to answer your question.

Cheers,
Michael


(Arethusa) #3

Hello,

I have server Icinga2 r2.7.1.1 on centos7.

My all host are supervised with SNMPv3 (and the server icinga2 too (from himself)).

So i have lot of snmpv3 check.

That work good, on icingaweb2 grid, all points are green.

But if one client is shutdown, of cause all services become red (plugin timed out while executing system call) it’s normal !

But in this case, my server icinga2 “don’t found the time” to check himself, and he have time out too on his service, (so red point on icingaweb2 and after, he sends mail), and after some seconds, all services are “recovery”.

So, when I have to many fail activities on a host (time out), my Icinga2 Server have also time out (just for some seconds).

But the ping is OK because ping is not checking by snmp.

So the snmp time out is the problem.

this is an exemple of check_snmpv3 :

#---------------------------
apply Service "02)CPU Usage in %" {
  import "generic-service"
  check_command = "snmpv3"
  vars.sla = "24x7"

  vars.snmpv3_oid = "1.3.6.1.2.1.25.3.3.1.2.196608"
  vars.snmpv3_label = "CPU used"

  vars.snmpv3_units = "%"
  vars.snmpv3_user = "snmp_user"

  vars.snmpv3_warn = 75
  vars.snmpv3_crit = 85

  vars.snmpv3_auth_alg = "SHA"
  vars.snmpv3_priv_alg = "AES"

  vars.snmpv3_auth_key = "SHA_password"
  vars.snmpv3_priv_key = "AES_password"

  assign where host.address
}
#---------------------------

It is why I need to increase the SNMP time out.

Maybe on snmpd.conf, but I don’t know.

Thank you.


#4

Looking at the documentation you’ll find an optional parameter which might be used to define a different timeout value.


(Arethusa) #5

Hello,

Yes “snmpv3_timeout” can be a solution, i must test it.

But i must modify my all services, if it’s the only solution I will do ^^

maybe it exists another global solution.

Thank you for your time.


(Michael Friedrich) #6

Better define a specific template (other than generic-service) and include that in your service apply rules for snmp.

/* Specify default snmpv3 settings, override them specifically in apply rules */
template Service snmpv3-tmpl" {
  check_command = "snmpv3"

  vars.snmpv3_timeout = 5m

  vars.snmpv3_units = "%"
  vars.snmpv3_user = "snmp_user"

  vars.snmpv3_auth_alg = "SHA"
  vars.snmpv3_priv_alg = "AES"

  vars.snmpv3_auth_key = "SHA_password"
  vars.snmpv3_priv_key = "AES_password"
}
apply Service "02)CPU Usage in %" {
  import "snmpv3_tmpl" // <---- here

  vars.snmpv3_oid = "1.3.6.1.2.1.25.3.3.1.2.196608"
  vars.snmpv3_label = "CPU used"

  vars.snmpv3_warn = 75
  vars.snmpv3_crit = 85

  assign where host.address
}

(Arethusa) #7

Hello,

Independently of the time out problem, your configuration is better.

But where are store the template?

I try #locate generic-service, but nothing.

Can I create it on /etc/icniga2/conf.d ?

Thank you.

Edit : I suppose i can have the template on the same .conf :stuck_out_tongue: , I will try


(Michael Friedrich) #8

If this is a distributed setup, I’d organise templates in zones.d/global-templates/templates.conf … if not, a local included path of my own put in icinga2.conf, e.g. objects.d/templates.conf


(Arethusa) #9

Hello,

I created template in /etc/icinga2/conf.d/templates.conf

That is nice, the icinga CPU usage was 40% and now 20%, this is the same for process, before i had near 220, and now near 170.

But, i have lost some reactivities, for example, if i stop snmpd on one host, i need more time to have an alert, but they come together.

Without template, the alert come one by one.

But now, it’s ok.

Thank you!