SNMP reports correctly, Cacti reports wrong?

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

Moderators: Developers, Moderators

User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

Hi people,

I'm having a problem with a large disk array. SNMP reports the right size, but Cacti graphs it wrong. Here's what I found out.

An snmpwalk to the server (from monitoring server):

Code: Select all

snmpwalk -v2c -c public x.x.x.x hrStorageTable
Results (snipped):

Code: Select all

HOST-RESOURCES-MIB::hrStorageDescr.35 = STRING: /storage
HOST-RESOURCES-MIB::hrStorageAllocationUnits.35 = INTEGER: 32768 Bytes
HOST-RESOURCES-MIB::hrStorageSize.35 = INTEGER: 1187305184
This is how to calculate total disk space:

Code: Select all

hrStorageAllocationUnits x hrStorageSize /1024 / 1024 / 1024 / 1024 = xxTB's
So:

Code: Select all

32768 x 1187305184 / 1024 / 1024 / 1024 /1024 = ~ 35 TB
Cacti however gives this as a result:

Image

Now I am aware there is a plugin to report correct disk size, but why do I need that plugin if SNMP reports everything correctly?
(http://docs.cacti.net/usertemplate:data ... disk_usage)

Please advice / help?
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

Does it have to do with hrStorageAllocationUnits being hardcoded in Cacti to 4096 bytes?
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

Nobody can help me with this? I need to know if this is indeed a Cacti bug...
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by phalek »

Cybex wrote:Does it have to do with hrStorageAllocationUnits being hardcoded in Cacti to 4096 bytes?
I'd say yes. Probably a new storage template may get around this making use of SNMP only, I'll check.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

That would be awesome!
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

[s]The value is in ss_host_disk.php, line 91: 4294967296[/s]

4294967296 / 1024 / 1024 = 4096

EDIT: Nevermind, I was wrong.
EDIT2: Hardcoded 4096 bytes doesn't make sense. I'm currently filling the array with data, but the graph just stops at 4TB (total) and 2TB (data). Seems like it just can't count higher? Is this perhaps a 32-bit limit?
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

Should I file a bug report?

I'm using Cacti for years now and I still love it, but it seems to me that the project is almost dead? Looking at this for example: http://bugs.cacti.net/my_view_page.php, not very active right?
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by phalek »

Just checked the code as well as some reports. It's something that happens in the Net-SNMP library, which is strictly intepreting the hrStorageUsed and hrStorageSize values as 32bit integer. Based on your output, the snmpwalk command from the CLI seems to use a "just-don't-care" method so it's returning the value "as-is":

https://groups.google.com/forum/#!topic ... ZqPtAO5dTA
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Howie »

hrStorageUsed and hrStorageSize *can* both be 32-bit integers with no problems though - Cacti is just ignoring the block size.

Although the code I'm looking at doesn't have 4096 hardcoded, it uses the allocation units: (this is from ss_host_disk.php on Cacti 0.8.8a)

Code: Select all

return $snmp_data * $sau;
(sau being the storage allocation unit size)

Which template are you using? and on which version of Cacti?

(I mean, there are also problems with 32-bit overflow when you have a large fs of small blocks, but I don't think this is it)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

I created the graphs by using "ucd/net SNMP host", so it's using "ucd/net - Get Monitored Partitions". I'm using version 0.8.8b.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by phalek »

But that's not using the ss_host_disk.php file, but is purely snmp based:

Code: Select all

                <dskAvail>
                        <name>Available Space</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.2021.9.1.7</oid>
                </dskAvail>
                <dskUsed>
                        <name>Used Space</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.2021.9.1.8</oid>
                </dskUsed>
Check the OID values of these and what they return for your system.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

snmpwalk @ .1.3.6.1.4.1.2021.9.1.7

Code: Select all

UCD-SNMP-MIB::dskAvail.1 = INTEGER: 45336776
UCD-SNMP-MIB::dskAvail.2 = INTEGER: 323834
UCD-SNMP-MIB::dskAvail.3 = INTEGER: 1877564
UCD-SNMP-MIB::dskAvail.4 = INTEGER: 18958228
UCD-SNMP-MIB::dskAvail.5 = INTEGER: 2147483647
snmpwalk @ .1.3.6.1.4.1.2021.9.1.8

Code: Select all

UCD-SNMP-MIB::dskUsed.1 = INTEGER: 2499272
UCD-SNMP-MIB::dskUsed.2 = INTEGER: 52358
UCD-SNMP-MIB::dskUsed.3 = INTEGER: 35860
UCD-SNMP-MIB::dskUsed.4 = INTEGER: 176104
UCD-SNMP-MIB::dskUsed.5 = INTEGER: 2147483647
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by phalek »

Here you go ...

UCD-SNMP-MIB::dskAvail.5 = INTEGER: 2147483647
UCD-SNMP-MIB::dskUsed.5 = INTEGER: 2147483647

2147483647 = 2 TB

= Total 4TB ...
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
Cybex
Posts: 49
Joined: Tue Sep 20, 2005 7:57 am
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by Cybex »

Right, so what do I have to do to solve this? Use an other template?
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SNMP reports correctly, Cacti reports wrong?

Post by phalek »

Try using the "SNMP - Get Mounted Partitions" one.

It's using the hrStorage... snmp data.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests