Icinga , plugin Error for few network decices

Hi ,

I am getting below plugin error for few of the Network devices getting monitored through ICINGA 2

Icinga py error:

Traceback (most recent call last):

File “/etc/icinga2/scripts/prod_scripts/SNMP_Gauge_Check.py”, line 32, in

if int(value)<int(warning):

ValueError: invalid literal for int() with base 10: ‘Such’

Hi,

Check your scripts line 32. My guess: some value conversion problem, int<>float, int<>string or similar.
Searching for the error message shows many results:
https://www.ecosia.org/search?q=ValueError%3A%20invalid%20literal%20for%20int()%20with%20base%2010%3A%20‘Such’

1 Like

same , Script is working for many of the Devices which are getting monitored.
yes … its seems some Value Coversion problem ,
Seems Value of one of the Veriable is reporting Empty that is the reason we are getting this error .
need to investigate why the value is come empty for few of the devices.
On further investigating , i noticied that ; impacted device is not reachable at TCP Port 161 from ICINGA Checker .
Can some one put more light on this issue.

SNMP usually is UDP/161.
Check your Firewalls, check if the devices have SNMP correctly configured.

required ports are open at firewall side…
could you please help me what Exact SNMP Configuration do i need to check.

Depends on how you query SNMP.

“Simple”: Using SNMP Version 1 or 2/2c, you will only need to configure a SNMP community. Depending on the device you will need to allow IPs/hostnames to query using this community.

“Secure”: Using SNMP Version 3. You need to configure a user and password, authentication methods as well as allowed hosts to query(I think).

My tip: search the web for snmp configuration <my device>

Hi ,
SNMP_Gauge_Check.txt (1.4 KB)
If i want to locally execute the plugin “/etc/icinga2/scripts/prod_scripts/SNMP_Gauge_Check.py” , could you please help me with the syntax…

I have also upload the Script , for your refrence.

The script looks like it is doing a simple snmp-get on a specific OID.
There is a much better scripts (and way better documented) than yours for that:
check_snmp: https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#snmp
or in case you are using SNMPv3: https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#snmpv3

As you seem new to icinga (or monitoring in general) I would suggest you read the documentation.
Monitoring basics: https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/
Configuration introduction: https://icinga.com/docs/icinga2/latest/doc/04-configuration/
Service monitoring: https://icinga.com/docs/icinga2/latest/doc/05-service-monitoring/

Icinga 2 also comes with a set of pre-defined check commands inside its core. These will often cover the most basic checks you want to implement: https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/

This project has some good basic SNMP scripts, which are well documented and are also part of the Icinga integrated command set: http://nagios.manubulon.com

yes … i am very much new to ICINGA , but i have worked on HP monitoring Tools in past…

many thanks for your help… i will go through the doc’s , if any Queries i may come back.

Result of snmpget command

[root@lp000app0036 ~]# /usr/bin/snmpget -t 2 -v 3 -u surli -a SHA -A RLIG47k0e6hCY -x AES -X RLIE7n60RgWh6 -l authPriv 10.255.193.93 1.3.6.1.4.1.9.9.109.1.1.1.1.8.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.1 = Gauge32: 1

[root@ServerA ~]# /usr/bin/snmpget -t 2 -v 3 -u surli -a SHA -A RLIG47k0e6hCY -x AES -X RLIE7n60RgWh6 -l authPriv 10.255.192.78 1.3.6.1.4.1.9.9.109.1.1.1.1.8.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.1 = No Such Instance currently exists at this OID

[root@ServerB~]# /usr/bin/snmpget -t 2 -v 3 -u surli -a SHA -A RLIG47k0e6hCY -x AES -X RLIE7n60RgWh6 -l authPriv 10.255.192.78 1.3.6.1.4.1.9.9.109.1.1.1.1.8.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.1 = No Such Instance currently exists at this OID

Want to understand the meaning of result “Gauge32: 1” and "No Such Instance currently exists at this OID "

Means that behind this OID no data is stored., aka the device does not support this OID.
Gauge32
I would suggest that you check what kind of MIBs/OIDs you devices support, and what information they hold.
Sometimes you can download those MIB files from the device itself or from the website of the vendor. Some, like cisco, offer an online MIB browser.