WARNING: Result from SNMP not valid

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
pyroblade
Posts: 3
Joined: Thu Jan 22, 2009 9:44 am

WARNING: Result from SNMP not valid

Post by pyroblade »

Hi everybody,

It's my first post.
I'm encountering some difficulties with Cacti, I searched and tried debugging 2 days before posting but I don't know what to do now...

My environnement :
  • OS : RHEL4
    Cacti : Version 0.8.7b
    Poller : spine
    PHP : 5.2.4
    MySQL : 5.0.45

    SNMP :
    net-snmp-libs-5.1.2-11.EL4.10
    net-snmp-utils-5.1.2-11.EL4.10.0.1
    perl-Net-SNMP-5.2.0-1.2.el4.rf
    net-snmp-devel-5.1.2-11.EL4.10
    net-snmp-5.1.2-11.EL4.10.0.1
I have made an xml template to retrieve the temperature of CPU's AIX Blades from a Management Module... with REGEXP expression to get only numeric output

Code: Select all

<interface>
        <name>Get SNMP Blades Info</name>
        <description>Queries a host for a list of monitorable Blades</description>
        <oid_index>.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.1</oid_index>
        <index_order_type>numeric</index_order_type>
        <oid_num_indexes>1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.1.14</oid_num_indexes>

        <fields>
                <!-- Donnees en INPUT, recherche via SNMP des infos sur les blades -->

                <bladeID>
                        <name>Blade ID</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.1</oid>
                </bladeID>

                <bladeName>
                        <name>Blade Name</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.5</oid>
                </bladeName>

                   <!-- OUTPUT : Temperatures CPU -->

                <blade_cpu1_temp>
                        <name>CPU1 Temperature</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^\+([0-9]{2,3})\..*$</source>
                        <direction>output</direction>
                        <oid>1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.16</oid>
                </blade_cpu1_temp>

                <blade_cpu2_temp>
                        <name>CPU2 Temperature</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^\+([0-9]{2,3})\..*$</source>
                        <direction>output</direction>
                        <oid>1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.17</oid>
                </blade_cpu2_temp>

                <blade_cpu3_temp>
                        <name>CPU3 Temperature</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^\+([0-9]{2,3})\..*$</source>
                        <direction>output</direction>
                        <oid>1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.15</oid>
                </blade_cpu3_temp>

                <blade_cpu4_temp>
                        <name>CPU4 Temperature</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^\+([0-9]{2,3})\..*$</source>
                        <direction>output</direction>
                        <oid>1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.14</oid>
                </blade_cpu4_temp>

        </fields>
</interface>

First, I thought that my xml wasn't good.
I had this error messages :
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7706] WARNING: Result from SNMP not valid. Partial Result: CPU 2 Temp = +67.00...
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7706] SNMP: v1: mm_blade1, dsname: blade_cpu2_temp, oid: 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.17.14, value: U
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7705] WARNING: Result from SNMP not valid. Partial Result: CPU 3 Temp = +71.00...
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7705] SNMP: v1: mm_blade1, dsname: blade_cpu3_temp, oid: 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.15.13, value: U
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7702] WARNING: Result from SNMP not valid. Partial Result: CPU 1 Temp = +71.00...
01/22/2009 03:45:32 PM - SPINE: Poller[0] Host[14] DS[7702] SNMP: v1: mm_blade1, dsname: blade_cpu1_temp, oid: 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.16.10, value: U
When I do a snmpwalk, I have a good result :
[root@slx-008 rra]# snmpwalk -v1 -c xxxxx mm_blade1 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.16
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.1 = STRING: "CPU 1 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.2 = STRING: "CPU 1 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.3 = STRING: "CPU 1 Temp = +72.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.4 = STRING: "CPU 1 Temp = +64.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.5 = STRING: "CPU 1 Temp = +70.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.6 = STRING: "CPU 1 Temp = +60.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.7 = STRING: "CPU 1 Temp = +57.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.8 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.9 = STRING: "CPU 1 Temp = +68.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.10 = STRING: "CPU 1 Temp = +70.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.11 = STRING: "CPU 1 Temp = +67.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.12 = STRING: "CPU 1 Temp = +62.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.13 = STRING: "CPU 1 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.16.14 = STRING: "CPU 1 Temp = +69.00 Centigrade"
[root@slx-008 rra]# snmpwalk -v1 -c public mm_blade1 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.17
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.1 = STRING: "CPU 2 Temp = +73.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.2 = STRING: "CPU 2 Temp = +70.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.3 = STRING: "CPU 2 Temp = +73.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.4 = STRING: "CPU 2 Temp = +69.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.5 = STRING: "CPU 2 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.6 = STRING: "CPU 2 Temp = +72.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.7 = STRING: "CPU 2 Temp = +61.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.8 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.9 = STRING: "CPU 2 Temp = +72.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.10 = STRING: "CPU 2 Temp = +70.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.11 = STRING: "CPU 2 Temp = +67.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.12 = STRING: "CPU 2 Temp = +73.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.13 = STRING: "CPU 2 Temp = +74.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.17.14 = STRING: "CPU 2 Temp = +67.00 Centigrade"
[root@slx-008 rra]# snmpwalk -v1 -c public mm_blade1 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.15
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.1 = STRING: "CPU 3 Temp = +75.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.2 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.3 = STRING: "CPU 3 Temp = +72.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.4 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.5 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.6 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.7 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.8 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.9 = STRING: "CPU 3 Temp = +65.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.10 = STRING: "CPU 3 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.11 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.12 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.13 = STRING: "CPU 3 Temp = +71.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.15.14 = STRING: "Not Readable"
[root@slx-008 rra]# snmpwalk -v1 -c public mm_blade1 1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.14
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.1 = STRING: "CPU 4 Temp = +74.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.2 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.3 = STRING: "CPU 4 Temp = +72.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.4 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.5 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.6 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.7 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.8 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.9 = STRING: "CPU 4 Temp = +68.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.10 = STRING: "CPU 4 Temp = +69.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.11 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.12 = STRING: "Not Readable"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.13 = STRING: "CPU 4 Temp = +75.00 Centigrade"
SNMPv2-SMI::enterprises.2.3.51.2.22.1.5.3.1.14.14 = STRING: "Not Readable"
I had this code to my xml, in order to print the result.

Code: Select all

                <bladeTEST>
                        <name>Blade TEST</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:^\+([0-9]{2,3})\..*$</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.17</oid>
                </bladeTEST>
My REGEXP seems to work, but there's a strange result because I think it didn't recognize the oid index "BladeID":

Image

I change the xml (without the REGEXP), and the half of the returned value had disappear but the returned values still not associated with "BladeId" :

Code: Select all

                <bladeTEST>
                        <name>Blade TEST</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.17</oid>
                </bladeTEST>
Image


The original value is a string like : "CPUx Temp = +xx.xx Centigrade"
Cacti return : +xx.xx Centigrade

It seems like Cacti don't like "=" in the returned value, am I right ?
Someone could help me ?

PS : Sorry, my post is heavy but I think I had to give all the elements I had :o
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yes, I'm quite sure the "=" breaks it
Reinhard
pyroblade
Posts: 3
Joined: Thu Jan 22, 2009 9:44 am

Post by pyroblade »

Should I open a bug ?

Do you think the problem is in this function (lib/snmp.php) :

Code: Select all

function format_snmp_string($string) {
        /* strip off all leading junk (the oid and stuff) */
        $string = trim(ereg_replace(".*= ?", "", $string));
...
...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yep. If you can work out a better code, I'll happily accept it
Reinhard
pyroblade
Posts: 3
Joined: Thu Jan 22, 2009 9:44 am

Post by pyroblade »

I'm not expert in php but I'll try do debug if I find some time ... :wink:
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests