SNMP - Get Processor Information does not work properly

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

Moderators: Developers, Moderators

uidzer0
Posts: 6
Joined: Fri Sep 21, 2007 11:42 am
Location: Washington D.C.

SNMP - Get Processor Information does not work properly

Post by uidzer0 »

I am trying to add in the data query to run against a RH WS3 server (server24 below) and I am not getting any results from it in terms of CPU.

OS: Redhat WS3
Cacti: 0.8.6j (fully patched)
php: 5.2.4
rrdtool: 1.2.23
net-snmp: 5.0.9

Data Query Debug Information

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/path/to/cacti/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/path/to/php/bin/php -q /path/to/cacti/scripts/ss_host_cpu.php server24 15 2:161:500:COMMUNITY:::MD5::[None] index'
+ Executing script query '/path/to/php/bin/php -q /path/to/cacti/scripts/ss_host_cpu.php server24 15 2:161:500:COMMUNITY:::MD5::[None] query index'
+ Found data query XML file at '/path/to/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/path/to/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/path/to/cacti/resource/script_server/host_cpu.xml'

host_cpu.xml calls ss_host_cpu.php and looking in there, I see the following:

$oids = array(
"index" => ".1.3.6.1.2.1.25.3.3.1",
"usage" => ".1.3.6.1.2.1.25.3.3.1"
);

Output from snmpwalk command based on those:

[root@cactiserver]# snmpwalk -v 2c -c COMMUNITY server24 .1.3.6.1.2.1.25.3.3.1
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero

UPDATE:

I decided to try a newer version of net-snmp (5.2.4) and I got the same output.
uidzer0
Posts: 6
Joined: Fri Sep 21, 2007 11:42 am
Location: Washington D.C.

Post by uidzer0 »

I am still trying to figure out why I cannot get any information back from the SNMP - Get Processor Information. I have attached two pictures.. Any information or further troubleshooting steps would be extremely helpful.
Attachments
cacti_trouble1.jpg
cacti_trouble1.jpg (204.47 KiB) Viewed 28707 times
cacti_trouble2.jpg
cacti_trouble2.jpg (69.68 KiB) Viewed 28707 times
kernelphr34k
Posts: 46
Joined: Tue Jul 24, 2007 6:23 pm
Location: Oregon

Post by kernelphr34k »

I'm in the same boat. Can't get SNMP processor info for my localhost.

suse enterprise 10 linux(2.6.16 kernel)
cacti 0.8.6j + patches

net-snmp = 5.3.0.1-25.2
php5 = 5.1.2-29.5
rrdtool = 1.2.12-13.2

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/srv/www/htdocs/cacti-0.8.6j/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php5 -q /srv/www/htdocs/cacti-0.8.6j/scripts/ss_host_cpu.php tcp:127.0.0.1 1 1:161:500:COMM_STRING:::MD5::[None] index'
+ Executing script query '/usr/bin/php5 -q /srv/www/htdocs/cacti-0.8.6j/scripts/ss_host_cpu.php tcp:127.0.0.1 1 1:161:500:COMM_STRING:::MD5::[None] query index'
+ Found data query XML file at '/srv/www/htdocs/cacti-0.8.6j/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti-0.8.6j/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti-0.8.6j/resource/script_server/host_cpu.xml'
Last edited by kernelphr34k on Mon Sep 24, 2007 3:41 pm, edited 1 time in total.
uidzer0
Posts: 6
Joined: Fri Sep 21, 2007 11:42 am
Location: Washington D.C.

Post by uidzer0 »

I just tried a downgrade of cacti, from 0.8.6j to 0.8.6h and still had no success. I'm considering downgrading to a 4.x version of ucd-snmp and see if that makes a difference.
uidzer0
Posts: 6
Joined: Fri Sep 21, 2007 11:42 am
Location: Washington D.C.

Post by uidzer0 »

Update:

Installed a 4.x version of ucd-snmp, changed the setting in cacti to use ucd-snmp 4.x and also changed the paths to the snmp* binaries to reflect the ucd-snmp installation. The 'Get processor Information' data query still does not work.
kernelphr34k
Posts: 46
Joined: Tue Jul 24, 2007 6:23 pm
Location: Oregon

Post by kernelphr34k »

update for me.

I hope you don't mind me posting in this thread.. Sounds like we have almost the same issue...

I just added a windows box to devices, and was able to get the cpu info for the 2 procs on the box. Yet I'm unable to obtain the cpu info on the local linux box...
elgoretto
Posts: 5
Joined: Mon Sep 03, 2007 8:34 am

Post by elgoretto »

"Me too" :)
Many of linux SNMP devices (net-snmp versions 5.0.9, 5.2.3, or 5.4.1) don't show any item to be graphed (all Red Hat, Debian and Ubuntu boxes with same Data Query Debug Information as uidzer0, while Gentoo servers are OK).

re-Edit: During my last attempt to compile and install net-snmp 5.4.1 on a vmware ESX server host (OS like a RedHat distro), CPU shows up, so it' works. I'll try to compile it again but on a RedHat AS 4.

Btw, the "ucd/net - CPU Usage" works.
I use 0.8.6j,

--
edit: oops, I forgot: getting all CPUs on Windows machines works, as on Gentoo ones.
uidzer0
Posts: 6
Joined: Fri Sep 21, 2007 11:42 am
Location: Washington D.C.

Post by uidzer0 »

elgoretto wrote:"Me too" :)
Many of linux SNMP devices (net-snmp versions 5.0.9, 5.2.3, or 5.4.1) don't show any item to be graphed (all Red Hat, Debian and Ubuntu boxes with same Data Query Debug Information as uidzer0, while Gentoo servers are OK).

re-Edit: During my last attempt to compile and install net-snmp 5.4.1 on a vmware ESX server host (OS like a RedHat distro), CPU shows up, so it' works. I'll try to compile it again but on a RedHat AS 4.

Btw, the "ucd/net - CPU Usage" works.
I use 0.8.6j,

--
edit: oops, I forgot: getting all CPUs on Windows machines works, as on Gentoo ones.
Well, this is absolutely driving me crazy. I can not get the data query to work at all and it's my understanding that it has to work in order to get the multi cpu graphs to work. I've tried reinstalls, building from source, installing via rpm, etc, etc.. (the servers are RH WS3 boxes)
elgoretto
Posts: 5
Joined: Mon Sep 03, 2007 8:34 am

Post by elgoretto »

Sorry, I recently hadn't time enough to go on this problem.

So, I installed a new RedHat 4.5 testbox. I have to upgrade the net-snmp package provided because diskio isn't enabled by default on all RH4.x (what a pity).
See my previous post for my former tests with net-snmp and various distros.
[edit: note that the provided 5.1.2 net-snmp is correct regarding the SNMP - Get Processor Information datasource. It works "as is".]

Well I finally managed to compile net-snmp 5.4.1 on a RH AS 4.5 and get it working. For this to work, I had to disable SElinux, which seems to block any SNMP answer from the RH box.
And hurrah!, the SNMP - Get Processor Information datasource returned something :)

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 10.231.226.100 12 2:161:500:LABTECH_RO:::MD5::[None] index'
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/ss_host_cpu.php 10.231.226.100 12 2:161:500:LABTECH_RO:::MD5::[None] query index'
+ Found item [hrProcessorFrwID='0'] index: 0
If this may help:
  • modify /etc/selinux/config and set SELINUX=disabled
  • not sure but reboot could be a good idea :)
  • uninstall previous net-snmp package
  • compile net-snmp with options like these ones (any suggestion is welcome):
    ./configure --prefix=/ --exec_prefix=/usr --with-mib-modules=ucd-snmp/diskio --disable-set-support --with-default-snmp-version=2 --with-sys-contact="root@Unknown" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" --disable-mfd-rewrites --enable-as-needed --enable-shared --without-libwrap --without-rpm --without-bzip2 --without-zlib --without-elf --disable-manuals --disable-scripts
  • make install and enjoy :)
gangstafish
Posts: 2
Joined: Tue Oct 23, 2007 10:48 am

Post by gangstafish »

I am getting this same issue, so frustrating. I have a few machines with almost the same exact build except for versions on snmp. The machines with snmp v5.1.3 work fine, the versions of snmp v5.2+ don't work a lick.

On the machines that do give back cpu information you see the expected snmpwalk:
+ Found item [hrProcessorFrwID='0'] index: 0
+ Found item [hrProcessorFrwID='1'] index: 1

On the machines that don't work, you get no found items, but no errors either. It seems like versioning and I feel like I'am missing something extremely easy.
prajjwal
Posts: 1
Joined: Thu Oct 25, 2007 9:00 am

Post by prajjwal »

Hi,
I have been trying to get cacti to poll some computers I have access to here. Other machines work fine, but I am getting cpu graphing errors on a RHEL 4 machine. The computer is a Dual Core AMD Opteron(tm) Processor 880, and there are multiple CPUs. However, when I run the data query in debug mode, I get the following:

+ Running data query [9].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/cacti/scripts/ss_host_cpu.php xxxx.xxxxx.xxx 4 2:161:500:xxxxxxx:::MD5::[None] index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_host_cpu.php xxxx.xxxxx.xxx 4 2:161:500:xxxxxxx:::MD5::[None] query index'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/host_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/host_cpu.xml'

When I run snmpwalk, I can get the following output:
[prajjwal@xxxxx ~]$ snmpwalk xxxxx -v2c -c $community .1.3.6.1.2.1.25.3.3.1
HOST-RESOURCES-MIB::hrProcessorFrwID.768 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.769 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.770 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.771 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.772 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.773 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.774 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.775 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorLoad.768 = INTEGER: 2
HOST-RESOURCES-MIB::hrProcessorLoad.769 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.770 = INTEGER: 37
HOST-RESOURCES-MIB::hrProcessorLoad.771 = INTEGER: 55
HOST-RESOURCES-MIB::hrProcessorLoad.772 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.773 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.774 = INTEGER: 7
HOST-RESOURCES-MIB::hrProcessorLoad.775 = INTEGER: 9

There are no problems with other graphs. Can someone point me in the direction?

Thanks,
Prajjwal
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It would appear to me that the Agent on your box is hosed. You need to look at both your snmpd.conf file and the possibly upgrade/downgrade your agent. Because it is truely FUBAR.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
flashdumper
Posts: 2
Joined: Thu Nov 15, 2007 2:23 am

Post by flashdumper »

Hello. I've the similar prob. What if i resolve an INTEGER value, but I want that value in to represent on the Graph? How can I do that?
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

IMHO with Net-SNMP you should use the "ucd/net - CPU Usage" graph template instead of the "SNMP - Get Processor Information" data query.

To check if you'll get the proper values, try that :

Code: Select all

$ snmpwalk -v 1 -c yourcommunity xx.xx.xx.xx systemStats
UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0 kB
UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0 kB
UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 17 blocks/s
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 0 blocks/s
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 100 interrupts/s
UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 37 switches/s
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 1
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 97
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 72522780
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 6235299
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 2867141
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 2355462838
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 19555889
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 85304
UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 955122286
UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 493880696
UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 2719804467
UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 601861088
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 93380
UCD-SNMP-MIB::ssRawSwapIn.0 = Counter32: 8164
UCD-SNMP-MIB::ssRawSwapOut.0 = Counter32: 22437
[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]
elgoretto
Posts: 5
Joined: Mon Sep 03, 2007 8:34 am

Post by elgoretto »

Ok, I managed to build a net-snmp-5.4.1 rpm package, and successfully deployed it on a RHEL 4.5, with cacti being happy.

As already said, upgrading the snmp agent solved the problem discussed here.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests