Data Query failing on Add to Associated Data Query

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Data Query failing on Add to Associated Data Query

Post by vanc »

I'm getting errors when adding a new associated data query, when I do add this, I use the back button to go back. The data query I was trying to add is now listed with a success but 0 rows, 0 items. If I click on "Verbose Query" I get the same errors which are:

Code: Select all

Notice: Undefined index: arg_index in /usr/share/cacti/lib/data_query.php on line 98

Notice: Undefined index: script_path in /usr/share/cacti/lib/data_query.php on line 98

Notice: Undefined index: arg_query in /usr/share/cacti/lib/data_query.php on line 109

Notice: Undefined index: query_name in /usr/share/cacti/lib/data_query.php on line 109

Notice: Undefined index: script_path in /usr/share/cacti/lib/data_query.php on line 109

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/lib/data_query.php:98) in /usr/share/cacti/host.php on line 129
Below is the XML file I am trying to use, but I should probably explain what I am trying to do...

I'm trying to graph the temperature of CPU and System, for now I am trying to make it work for the CPU to get started. It looks to me that the machine I am attempting to get temps for does not have "MIB Variables" for the lmsensor information, which brings me to my first real question... does "query->fields->ifIndex" at ifIndex need to be the name of a MIB variable? If not can I create an arbitrary name here, or list the numerical OID? I am running 0.8.6h. Any help or insight would be greatly appreciated or alternatively debugging information. Thanks!

Code: Select all

<interface>
   <name>Get SNMP CPU Temp</name>
   <description>Queries a host for the CPU Temperature</description>
   <oid_index>host.8.1</oid_index>
   <index_order_type>numeric</index_order_type>

   <fields>
      <lmsensorIndex>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>input</direction>
         <oid>host.8.1</oid>
      </lmsensorIndex>
      <lmsensorCPU>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>host.8.1.5.22</oid>
      </lmsensorCPU>

   </fields>
</interface>
Additionally here is a snippet of the portion of snmpwalk I am trying to get...

Code: Select all

HOST-RESOURCES-MIB::host.8.1.5.22 = STRING: "39.400000"
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

Anyone have any thoughts? I'm going a little bit crazy not being able to figure this out.... thanks in advance.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I believe you must use the full OID instead of a combo of name+OID.

Also, since your snmpwalk returned host.8.1.5.22 you do not want to use that OID in the lmsensorCPU section.

Have you read through this guide? http://forums.cacti.net/viewtopic.php?t=11288
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

Firstly thanks for the response and helping.
BSOD2600 wrote:I believe you must use the full OID instead of a combo of name+OID.
I have changed this in the xml file to now look like the below code but getting the same errors on "verbose query".

Code: Select all

<interface>
   <name>Get SNMP CPU Temp</name>
   <description>Queries a host for the CPU Temperature</description>
   <oid_index>1.3.6.1.2.1.25.8.1</oid_index>
   <index_order_type>numeric</index_order_type>

   <fields>
      <lmsensorIndex>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>input</direction>
         <oid>1.3.6.1.2.1.25.8.1</oid>
      </lmsensorIndex>
      <lmsensorCPU>
         <name>GraphME</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>1.3.6.1.2.1.25.8.1.5.22</oid>
      </lmsensorCPU>
   </fields>

</interface>
Also, since your snmpwalk returned host.8.1.5.22 you do not want to use that OID in the lmsensorCPU section.
My very limited and perhaps incorrect knowledge of this thought that I would use the same OID as my index for my input for graphing the y-axis label. The value I am actually trying to receive is from OID 1.3.6.1.2.1.25.8.1.5.22 which is CPU temperature in celcius.

Am I way off on this? That is why I had the 8.1.5.22 listed for lmsensorCPU. Additionally, lmsensorCPU is an arbitrary name, is it not a MIB variable. At least not according to the host I am monitoring.
Have you read through this guide? http://forums.cacti.net/viewtopic.php?t=11288
YES, a few times, thanks again for your response and help.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

vanc wrote:

Code: Select all

<interface>
   <name>Get SNMP CPU Temp</name>
   <description>Queries a host for the CPU Temperature</description>
   <oid_index>1.3.6.1.2.1.25.8.1</oid_index>
   <index_order_type>numeric</index_order_type>

   <fields>
      <lmsensorIndex>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>input</direction>
         <oid>1.3.6.1.2.1.25.8.1</oid>
      </lmsensorIndex>
      <lmsensorCPU>
         <name>GraphME</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>1.3.6.1.2.1.25.8.1.5.22</oid>
      </lmsensorCPU>
   </fields>

</interface>
There are alreayd lmsensors resources to be found in the script and templates forum. It seems to me, that your task may not be solved using an snmp query. Is the CPU Temp OID part of a snmp table? See my last signature link for that
Reinhard
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

I've read through that forum as well but it doesn't look like it is in a table.

I get "Was that a table?" See below.

Code: Select all

areid@andre:~$ snmptable -v 2c XXX.105.14.150 -c XXXXX 1.3.6.1.2.1.25.8.1.5.
22
Was that a table? HOST-RESOURCES-MIB::host.8.1.5.22
areid@andre:~$ snmptable -v 2c XXX.105.14.150 -c XXXXX HOST-RESOURCES-MIB::h
ost.8.1.5.22
Was that a table? HOST-RESOURCES-MIB::host.8.1.5.22
areid@andre:~$ snmptable -v 2c XXX.105.14.150 -c XXXXX HOST-RESOURCES-MIB
HOST-RESOURCES-MIB: Unknown Object Identifier (Sub-id not found: (top) -> HOST-R
ESOURCES-MIB)
areid@andre:~$ snmptable -v 2c XXX.105.14.150 -c XXXXX HOST-RESOURCES-MIB::h
ost
HOST-RESOURCES-MIB::host: No entries
areid@andre:~$ snmptable -v 1 XXX.105.14.150 -c XXXXX 1.3.6.1.2.1.25.8.1.5.2
2
Was that a table? HOST-RESOURCES-MIB::host.8.1.5.22
areid@andre:~$
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

I have also grabbed those lmsensor templates but I didn't want to just go ahead and use them without understanding what the problem was with the query I was trying to build, for my understanding for future use etc.

Thanks Reinhard!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

vanc wrote:I've read through that forum as well but it doesn't look like it is in a table.

I get "Was that a table?" See below.
If this is no table, you approach will fail. Then it would be better to use a copy of the Generic SNMP OID Template or a Data Input Method
Reinhard
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

Was the way I was attempting to find a table correct?

Is it same to assume then if not an snmp table then can not use snmp query as I was trying?

Thanks for the help with this.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

vanc wrote:Was the way I was attempting to find a table correct?
No. Best way is to look at the MIB file to find any table. Or try to snmpwalk around this OID (try shorten the OID step by step)
Is it same to assume then if not an snmp table then can not use snmp query as I was trying?

Thanks for the help with this.
No table <=> no snmp data query
single OID <=> Generic OID|Data Input Method
multiple single OIDs (not part of table) <=> multiple Generic OID|Script Query
Reinhard
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

lvm wrote:No. Best way is to look at the MIB file to find any table. Or try to snmpwalk around this OID (try shorten the OID step by step)
I tried to attach the first table output that I could get and it was at a very high level, perhaps the entire snmp. It worked here: OID 1.3.6.1.2, but the file was too large.

Does it make sense that I could create a MIB definition for this so that a table could be located, on the host machine that is?

Something like:

Code: Select all

hrStorageVirtualMemory OBJECT-IDENTITY
    STATUS current
    DESCRIPTION
        "The storage type identifier used for virtual memory,
        temporary storage of swapped or paged memory."
    ::= { hrStorageTypes 3 }
Found in "/usr/share/snmp/mibs/HOST-RESOURCES-TYPES.txt" but for the values I am seeking.

Additionally I attached the entire results of an snmpwalk for this host if you have any insight that might be helpful...

Thanks again.

* UPDATE... I'm PM you the file. I wasn't feeling too comfortable having it posted here.
Last edited by vanc on Wed Mar 08, 2006 5:08 pm, edited 1 time in total.
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

HOST-RESOURCES-MIB::host.8.1.1.1

Looks like it "would" be the beginning of a table?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

vanc
I'm currently on the run with your case. And I'm SURE it will work using snmp XML query. I will build some XML from the snmpwalk you have sent; that's not that big of a deal. But unfortunately I don't have access to a system thta responds to those OIDs, so you will have to try this on your own (if it works, you may of course post the template to the forums? eh?)
But this will have to wait till weekend (developing = weekends, forums moderation = weekdays :lol: :( :o )
Reinhard
vanc
Posts: 30
Joined: Thu Mar 02, 2006 2:54 pm
Location: Boston MA USA
Contact:

Post by vanc »

Reinhard,

Awesome, thanks so much.

I'll change a community and give you access to a device to do tests on, let me just find one that isn't doing anything in production, probably it will be friday that I can get one up and running.

These devices are small book size PC's running via chipsets. http://www.synertrontech.com/products/e ... light.html

Thanks a lot for your help with this, and I definitely will post a template if we can get it working!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

vanc
please try following XML for your Data Query

Code: Select all

<name>Get System Environmental Data</name>
        <description>Get Environmental Data based on host-MIB</description>
        <index_order_type>numeric</index_order_type>
        <oid_index>.1.3.6.1.2.1.25.8.1.1</oid_index>

        <fields>
                <systemDataIndex>
                        <name>Index?</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.25.8.1.1</oid>
                </systemDataIndex>
                <systemDataDescr>
                        <name>Description</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.25.8.1.4</oid>
                </systemDataDescr>
                <systemDataValue>
                        <name>Value</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.25.8.1.3</oid>
                </systemDataValue>
                <systemDataReading>
                        <name>Reading</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.2.1.25.8.1.5</oid>
                </systemDataReading>
        </fields>
</interface>
Unfortunately, I was not able to find a MIB giving me more descriptive names for the OIDs. So I don't know, what the data of index 8.1.1 and 8.1.2 mean. Index 8.1.3 and 8.1.4 are sort of redundant. You may of course change the text fields in the XML to your likings. Please change the community string of the device you gave access to.
The solution was obtained by stripping off the last numbers of the given OID step by step and snmpwalk-ing the rest. host.8.1.1 seems to be base of an snmp table (for those who like to learn from this)
Happy cactiing
Reinhard
Post Reply

Who is online

Users browsing this forum: anwaraahmad1 and 0 guests