jjmartres / Zabbix

A great collection of Zabbix scripts and templates
GNU General Public License v2.0
881 stars 584 forks source link

if.speed error #84

Open forall opened 9 years ago

forall commented 9 years ago

Hi,

I found problem with if.speed scripts..

Received value [/var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:49:in send': getaddrinfo: Name or service not known (SocketError) from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:49:insend' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:519:in send_request' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:503:inblock in try_request' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:502:in times' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:502:intry_request' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:245:in get' from /usr/lib/zabbix/externalscripts/if.speed:68:inblock in

' from /var/lib/gems/1.9.1/gems/snmp-1.2.0/lib/snmp/manager.rb:218:in open' from /usr/lib/zabbix/externalscripts/if.speed:67:in
'] is not suitable for value type [Numeric (unsigned)] and data type [Decimal

elvar152 commented 9 years ago

I am having the same problem.

intrepidsilence commented 8 years ago

Did you ever figure out what this was? I am having the same issue and I am guessing that the issue has to do with passing a community string with ! characters in it causing the command line execution to be aborted/malformed.

dryicebomb commented 8 years ago

Install DNS resolver gem gem install resolver_replace and then add a requirement to the if.speed script. require 'resolv-replace'

https://github.com/jjmartres/Zabbix/pull/88 http://www.subelsky.com/2014/05/fixing-socketerror-getaddrinfo-name-or.html https://github.com/dryicebomb/Zabbix/tree/master/zbx-scripts/if.speed

intrepidsilence commented 8 years ago

Unfortunately this did not fix the issue. Here is the error I see from the red X next to the Item in Zabbix:

Received value [/usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:49:in send': getaddrinfo: Name or service not known (SocketError) from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:49:insend' from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:519:in send_request' from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:503:intry_request' from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:502:in times' from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:502:intry_request' from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:245:in get' from /usr/lib/zabbix/externalscripts/if.speed:68 from /usr/lib/ruby/gems/1.8/gems/snmp-1.2.0/lib/snmp/manager.rb:218:inopen' from /usr/lib/zabbix/externalscripts/if.speed:67] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

Thanks again for your assistance with this...

Michael

From: "dryicebomb" notifications@github.com To: "jjmartres/Zabbix" Zabbix@noreply.github.com Cc: "Michael Spurlock" michael.spurlock@greyspaces.net Sent: Friday, February 26, 2016 4:21:55 PM Subject: Re: [Zabbix] if.speed error (#84)

Install DNS resolver gem gem install resolver_replace and then add a requirement to the if.speed script. require 'resolv-replace'

88

http://www.subelsky.com/2014/05/fixing-socketerror-getaddrinfo-name-or.html https://github.com/dryicebomb/Zabbix/tree/master/zbx-scripts/if.speed

— Reply to this email directly or view it on GitHub .

dryicebomb commented 8 years ago

What happens if you run the script from the CLI of your zabbix proxy/server with the values that it displays in the "key" field of the item?

intrepidsilence commented 8 years ago

Works just fine.

From: "dryicebomb" notifications@github.com To: "jjmartres/Zabbix" Zabbix@noreply.github.com Cc: "Michael Spurlock" michael.spurlock@greyspaces.net Sent: Monday, March 7, 2016 9:25:23 AM Subject: Re: [Zabbix] if.speed error (#84)

What happens if you run the script from the CLI of your zabbix proxy/server with the values that it displays in the "key" field of the item?

— Reply to this email directly or view it on GitHub .

MAG986FS commented 8 years ago

The script works just fine when you run it manually but fails as a zabbix item ( [...] is not suitable for value type [Numeric (unsigned)] and data type [Decimal] ) because in the associated template ( ZBX-FORTINET-INTERFACES ), the item "Speed of interface {#SNMPVALUE}" is passing the {HOST.HOST} macro to the script.

Modify the item to use the {HOST.IP} macro instead of {HOST.HOST} and it fixes it.

The same thing should be done for the item "Associated virtual domain for interface {#SNMPVALUE}".

Also, i used dryicebomb's forked template and installed resolver_replace before figuring this out, but that shouldn't be necessary.

François