SNMP Check - Allnet ALL3500

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




    i'm trying to monitor some temperatures of the ALLNET ALL3500 Device. Therefore, I downloaded the .mib-file and parsed the OIDs.


    For example the temperature "Temp1" is OID "1.3.6.1.4.1.19935.1.103.3.1.1.1.65".

    If I use "snmpget" to check the parameter all is going well (temp is 3,93 °C at the moment)

    Code
    1. snmpget -v 2c -c public 192.168.1.245 1.3.6.1.4.1.19935.1.102.3.1.1.1.65
    2. iso.3.6.1.4.1.19935.1.102.3.1.1.1.65 = STRING: "3.9300"



    This is the check I wrote:




    And this is the result:



    I dont understand why there are brackets, a "u" and quotation marks in the result.

    This type of result makes performance data impossible.


    Is anyone able to help? :-)


    Regards,

    Johannes

  • info is a list of lists, you have to get one level deeper to access your actual value, not the list itself:


    for line in info:

    temp = line[0]

  • The u'number' thing is a unicode string. You need to cast it to float with float(temp) if you want to perform any numeric operations (comparing it to WARN/CRIT levels, etc.)