Over 8Tbyte DiskSpace cant get correct TotalSpace

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

Moderators: Developers, Moderators

katayama
Posts: 2
Joined: Tue Aug 19, 2008 7:59 pm

Over 8Tbyte DiskSpace cant get correct TotalSpace

Post by katayama »

I use large Disk Space (Over 10Tbyte) in Windows.
I graphed disk usage in cacti 0.8.7b but Total Disk Space cant get correct data from snmp.(attached graph)

I check snmpwalk. I get following data.
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: C:\ Label: Serial Number aaaaaaaa
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: D:\
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: E:\ Label: Serial Number ccccccccc
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: F:\ Label: Serial Number bbbbbbbb
HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 0 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 7865817
HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 114190019
HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: -876942081
I guess scripts/ss_host_disk.php need fix.
I search this forum and bug report site , but I cant find patch relate this things.

anyone fixed it?
Attachments
cant get total disk space
cant get total disk space
graph_image.php.png (26.13 KiB) Viewed 16061 times
katayama
Posts: 2
Joined: Tue Aug 19, 2008 7:59 pm

Post by katayama »

sorry , I fixed myself.

patch is here

Code: Select all

--- ss_host_disk.php.back       2008-03-28 18:32:32.000000000 +0900
+++ ss_host_disk.php    2008-08-20 12:01:07.000000000 +0900
@@ -75,7 +75,12 @@
 
                if (($arg == "total") || ($arg == "used")) {
                        $sau = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageAllocationUnits' and snmp_index='$index'"));
-                       return cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol,$snmp_priv_passphrase,$snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER)* $sau;
+                       $snmp_data = cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol,$snmp_priv_passphrase,$snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER);
+                       if( preg_match('/^-/',$snmp_data) ){
+                               return (abs($snmp_data) + 2147483647) * $sau;
+                       } else {
+                               return $snmp_data * $sau;
+                       }
                }else{
                        return cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol,$snmp_priv_passphrase,$snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER);
                }
and fixed graph is attached.
Attachments
graph_image.php.png
graph_image.php.png (27.42 KiB) Viewed 16051 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Thank you for the solution. Please post a bug as given by http://www.cacti.net/bugs.php and attach all information. Then we'll integrate it into cacti asap
Reinhard
nileshmistry73
Posts: 2
Joined: Wed Apr 08, 2009 10:39 am

Post by nileshmistry73 »

Hello

I am running the same version of cacti and applied the patch manually, but still having the same problem.

Is there anything I am missing other then applying the changes to ss_host_disk.php?

Nilesh
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Is your windows snmp counter also rolling over, like the OP was? More of an issue with the SNMP agent instead of Cacti not reporting the correct value, IMO.
opoplawski
Posts: 1
Joined: Thu Jun 25, 2009 5:32 pm

Fix calculation

Post by opoplawski »

katayama wrote:

Code: Select all

                       if( preg_match('/^-/',$snmp_data) ){
                               return (abs($snmp_data) + 2147483647) * $sau;

Integer wrapping doesn't work that way. I think this is what you want:

Code: Select all

                        if($snmp_data<0){
                                return ($snmp_data + 4294967296) * $sau;
kevinadmin
Posts: 5
Joined: Thu Feb 21, 2008 10:52 pm

Post by kevinadmin »

ths i solved my problem.

but the disk used percent can not display,and it's no data . why?

i found the same in the smaller disk also.

it is the bug on 0.8.7e version?
kevinadmin
Posts: 5
Joined: Thu Feb 21, 2008 10:52 pm

Post by kevinadmin »

Can not get the data
and in the ss_host_disk.php script, can not find about percent any more
Attachments
Can not get the data <br />and in the ss_host_disk.php script, can not find about precent any more
Can not get the data
and in the ss_host_disk.php script, can not find about precent any more
123.jpg (13.6 KiB) Viewed 14952 times
mbails
Posts: 31
Joined: Thu Jan 24, 2008 12:52 pm
Location: Phoenix
Contact:

Post by mbails »

Can anybody provide a patched ss_host_disk.php?
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Integrated into Cacti?

Post by computer_guru »

The fix mentioned in this thread for large hard drives appears to have never been integrated into the cacti code. Any reason for this?

I checked the changes and I did not see this addition:
http://svn.cacti.net/viewvc/cacti/branc ... p?view=log


Anybody find a good solution?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Integrated into Cacti?

Post by gandalf »

computer_guru wrote:Any reason for this?
Lack of memory and no bug report. Sorry, sometimes it's that simple. But it's hard to track forum messages AND bug reports. So we prefer doing the last. :-?
R.
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Post by computer_guru »

I am currently trying to perfect the PHP code. Applying the fix above put the free space in place of the total space.

Shall I put in a bug report?
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Here is my version of script

Post by computer_guru »

Attached is my version of the ss_host_disk.php file. It should be able to handle 16 TB drives and smaller with a ntfs cluster size of 4096.

If you want to handle larger drives, than use a larger NTFS cluster size.

More about ntfs cluster size:
http://www.ntfs.com/ntfs_optimization.htm


[update]
File removed. Download the newer version on page two of this thread.
Last edited by computer_guru on Mon Mar 07, 2011 11:32 am, edited 2 times in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

computer_guru wrote:I am currently trying to perfect the PHP code. Applying the fix above put the free space in place of the total space.

Shall I put in a bug report?
Yes, please. See http://www.cacti.net/bugs.php
R.

BTB: Do you know this one? http://docs.cacti.net/usertemplate:data ... disk_usage
Pure SNMP, fast, does take block size into account automatically. But not tested against such a big device as I do not own such
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Post by computer_guru »

If found this bug as already reported:
http://bugs.cacti.net/view.php?id=1292


I updated it with my proposed solution.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest