[SNMP] data query returned 0 rows, what's wrong?

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

Moderators: Developers, Moderators

Post Reply
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

[SNMP] data query returned 0 rows, what's wrong?

Post by Krietjur »

I've setup cacti and I'm having problems with displaying CPU and disk-stats using the SNMP data query.

The SNMP - Interface Statistics query is working just fine. The queries "SNMP - Get Mounted Partitions" and "SNMP - Get Processor Information" won't work. They both give this message: This data query returned 0 rows, perhaps there was a problem executing this data query.

When I run the query in debug mode, I get this result:

Code: Select all

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/ss_host_cpu.php data.mycompany.nl 8 2:161:500:public:::MD5::[None] index'
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/ss_host_cpu.php data.mycompany.nl 8 2:161:500:public:::MD5::[None] query index'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
I've tried this for multiple hosts, all have the same problem. I'm using Cacti version 0.8.6g . Any idea's on this issue?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

what is the operating system on the polled device ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

The polled device is running Linux (debian), de Cacti machine is running Linux (Gentoo)
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Could you try this as /etc/snmp/snmpd.conf on the Debian box :

Code: Select all

rocommunity public
disk /
and reload the queries ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

Sorry for the late response, I had some days free from work ;)

I've added those lines to snmpd.conf, restarted snmpd, reloaded the data query in Cacti, but still 0 rows returned.
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

I saw this announcement: http://forums.cacti.net/viewtopic.php?t=9352, done that and I've got the diskstats running now. My cpu-query is still returning 0 rows. Do I need something special in my snmpd.conf ?
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

*kick*
I still don't get my cpu load working :(

My snmpd.conf is very small, perhaps I need to add something there?
Here is my snmpd.conf:

Code: Select all

com2sec local     127.0.0.1/32    public
com2sec local     192.168.0.0/24   public

group MyROGroup v1         local
group MyROGroup v2c        local
group MyROGroup usm        local

view all    included  .1                               80

access MyROGroup ""      any       noauth    exact  all    none   none

syslocation somewhere
syscontact someone<1@2.3>
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Try

Code: Select all

snmpwalk -c <community> -v 1 <your host> .1.3.6.1.4.1.2021.11
to see, whether the host responds to snmp requests for host cpu OIDs. This should look like

Code: Select all

UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0
UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0
UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 30
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 27
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 1140
UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 413
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 9
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 1
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 88
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 79887
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 5288
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 15028
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 802256
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 12431
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 14059
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 821
UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 545040
UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 491044
UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 10276421
UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 3722420
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 148
UCD-SNMP-MIB::ssRawSwapIn.0 = Counter32: 0
UCD-SNMP-MIB::ssRawSwapOut.0 = Counter32: 0
Reinhard
andret
Posts: 1
Joined: Wed Dec 21, 2005 6:06 pm

SNMP - Get processor information

Post by andret »

I have the same problem with getting CPU info via SNMP.
THe server and remote hosts are all running SuSE 9.3

When I run the verbose query, I get the following:

Code: Select all

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/scripts/ss_host_cpu.php 192.168.1.5 public 1 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_host_cpu.php 192.168.1.5 public 1 query index'
+ Found data query XML file at '/usr/share/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_server/host_cpu.xml'
But, when I run the suggested snmpwalk on the cacti server :

Code: Select all

snmpwalk  -c public -v 1 192.168.1.5 .1.3.6.1.4.1.2021.11
Then I get the following:

Code: Select all

UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0
UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0
UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 3
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 0
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 11
UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 14
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 5
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 1
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 93
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 8407540
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 7474071
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 4489664
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 265375751
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 445200
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 3256183
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 33792
UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 102004022
UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 172915736
UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 3253383199
UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 1026742908
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 1199689
UCD-SNMP-MIB::ssRawSwapIn.0 = Counter32: 3667
UCD-SNMP-MIB::ssRawSwapOut.0 = Counter32: 4012
Are there some cacti settings that I need to change?

Thanks
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

The output from

Code: Select all

snmpwalk -c <community> -v 1 <your host> .1.3.6.1.4.1.2021.11
looks like what it should look like. But, still zero rows in cacti :(
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please goto Settings and select DEBUG as Logging Level. Run this for at least one polling cycle. Please have a look at <path_cacti>/log/cacti.log and search for the numeric OID. Please post your findings
Reinhard
Krietjur
Posts: 14
Joined: Thu Dec 01, 2005 8:15 am
Location: Holten, the Netherlands
Contact:

Post by Krietjur »

I've done that now, but the numeric OID doesn't apear in my logfiles. I have the dataquery "SNMP - Get Processor Information" enabled for the host, data query debug information shows :

Code: Select all

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/ss_host_cpu.php 192.168.1.1 8 2:161:500:public:::MD5::[None] index'
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/ss_host_cpu.php 192.168.1.1 8 2:161:500:public:::MD5::[None] query index'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_server/host_cpu.xml'
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Krietjur wrote:I've done that now, but the numeric OID doesn't apear in my logfiles. I have the dataquery "SNMP - Get Processor Information" enabled for the host
Sorry for that. But this is a script query, that is, the SNMP calls are executed from within the script. So you won't see these OIDs in the log file. There's another approach which is based on the ucd/net - CPU Usage SNMP query.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests