Question about Data Queries

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

Moderators: Developers, Moderators

Post Reply
eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

Question about Data Queries

Post by eyechart »

I'm having some problems running the data queries provided in cacti against the polling hosts I have defined. I am running cacti on mandrake, and my polling hosts are all win2k (at this point).

The SNMP Interface Statistics data query runs fine against all polling hosts, so I know that SNMP configuration is good. However, when I run the SNMP Get Processor Information query against a win2k host, I get nothing.

Here are the questions:
1. Does this query work against win32 boxes? Is this just a problem with running cacti on linux and polling win2k boxes?
2. If not, can it be modified to work? It looks like the OIDs are actually there in the win2k environment.
3. How can one debug a data query that failed? I have no idea where to look when this thing fails.



Thanks for the help.


-ec
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The "SNMP - Get Processor Information" data query makes use of the host MIB, but it is typically only useful for Windows machines. If graphing traffic for your Win2k machines works, your SNMP service is probably setup correctly.

I have a feeling that you are running into a 0.8.3 bug. Check out the following post for more details including how to fix it:

http://www.raxnet.net/board/viewtopic.php?p=7710#7710

-Ian
eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

Post by eyechart »

I put the two changes in that were suggested, but I am still having the same problem. Is there a way to see the errors that occur during a failed data query?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The get processor information data query is a script query, which are easier to debug. Open up a terminal and cd to Cacti's scripts directory. Now type:

Code: Select all

php query_host_cpu.php <host> <snmp_community> index
Make sure to fill in the hostname and SNMP community string for the host you want to query. The output should consist of one line for each processor (0,1,2,3,etc). The same general idea should work 'query_host_partitions.php' as well.

-Ian
eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

Post by eyechart »

raX wrote:The get processor information data query is a script query, which are easier to debug. Open up a terminal and cd to Cacti's scripts directory. Now type:

Code: Select all

php query_host_cpu.php <host> <snmp_community> index
Make sure to fill in the hostname and SNMP community string for the host you want to query. The output should consist of one line for each processor (0,1,2,3,etc). The same general idea should work 'query_host_partitions.php' as well.

-Ian
OK, the script runs fine this way from the command line. However, when run from the Data Query in cacti, it fails. Any ideas?


-ec
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

eyechart wrote:OK, the script runs fine this way from the command line. However, when run from the Data Query in cacti, it fails. Any ideas?
I want to see what Cacti is actually trying to execute when running the script query. Can you download the following file and replace your 'include/snmp_functions.php' with it?

http://www.raxnet.net/downloads/patches ... ns.php.txt

When you try to add one of these data queries, Cacti will print out the full path to the script query it is trying to execute.

-Ian
eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

Post by eyechart »

raX wrote: I want to see what Cacti is actually trying to execute when running the script query. Can you download the following file and replace your 'include/snmp_functions.php' with it?

http://www.raxnet.net/downloads/patches ... ns.php.txt

When you try to add one of these data queries, Cacti will print out the full path to the script query it is trying to execute.
Here is what I get for CPU:

/usr/bin/php -q /var/www/html/cacti/scripts/query_host_cpu.php 10.17.8.8 cacti index

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/include/snmp_functions.php:74) in /var/www/html/cacti/host.php on line 92

Here is what I get for mounted partitions:

/usr/bin/php -q /var/www/html/cacti/scripts/query_host_partitions.php 10.17.8.8 cacti index

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/include/snmp_functions.php:74) in /var/www/html/cacti/host.php on line 92


-ec
eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

Post by eyechart »

Rax,

Your post in another thread seems to have fixed my problem. See http://www.raxnet.net/board/viewtopic.p ... ight=#7918.

I am not sure if the Get Mounted Partitions query is actually returning data. Atleast now it shows up in the Polling Hosts screen when selected.

Thanks!

-ec
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests