Cactiusers.org


It is currently Fri Jul 03, 2009 6:35 pm




Post new topic Reply to topic  [ 10 posts ] 
 THOLD 0.3.9 and HDD percent 
Author Message
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post THOLD 0.3.9 and HDD percent
Just got Cacti up and runing with all the Plugins I want and .8.7a as the underlying (after updating CactiEZ).../

Installed the latest version of the Plugin Architecture.

Everything *looks* like its working. Getting good graphs.

OK so then I set up thresholds, or like to think I do...

Goto Theshold Template, select the Graph Template :Host MIB - Hard Drive Space

Choose data field HDD_percent

Then I apply the Threshold Template to my host (one Win2k3 machine at the moment, until I get this working again, then take an image of the install).

Then check back in 5minutes and see that all the disk thresholds are RED!!! Ok, I think - lets check the serves - all OK - plenty of room - the fullest has 35% free...

So look again - the Threshold page looks like this:

Quote:
1 Pamplona02 - EX2K3 - Used Space - C: Label:O/S Se [hdd_percent] 90 off 23291142656 YES
3 Pamplona02 - EX2K3 - Used Space - E: Label:exchan [hdd_percent] 90 off 187437666304 YES
5 Pamplona02 - EX2K3 - Used Space - Virtual Memory [hdd_percent] 90 off 2797469696 YES
16 Pamplona02 - EX2K3 - Used Space - Virtual Memory [hdd_used] 90 off 2797469696 YES
6 Pamplona02 - EX2K3 - Used Space - Physical Memory [hdd_percent] 90 off 1899757568 YES
14 Pamplona02 - EX2K3 - Used Space - D: Label:New Vo [hdd_used] 90 off 108490752 YES
12 Pamplona02 - EX2K3 - Used Space - D: Label:New Vo [hdd_percent] 91 off 10487230464 YES


Thus the Current Value is WAY above the real value of % used... (Which all the graphs show correctly).

Any way to solve this.... Am I doing something wrong?

I am thinking of a work around involving CDEFs but don't really want to do that if I'm being stupid here.

Argon0


Thu Jan 31, 2008 10:13 am
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post 
OK, looks like the graph template uses a CDEF to get its values, WHY? maybe the hdd_percent data source is broken?

Lets see what I can do with CDEFs in thresholds.


Thu Jan 31, 2008 10:19 am
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post 
I can do anything I like with the CDEFs as long as I only use the current value...

<groan>

OK so I need to make a new data source.... But how to do that? Using the two data sources to create a third, SHOULD be possible, but is it?

The CDEF is easy a,b,/,100,*
Where a is the htt_used, and b is the hdd_total - the graph does it easily.... But can't see any way to use that in Data sources....

Could run the script and see what it comes back with for hdd_percent, see if there is something I can do there?

But then that'd mean rewriting the script, and probably overwriting when I upgrade next time... Groan...

Anyway - its a challenge...


Thu Jan 31, 2008 10:28 am
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post 
OK, this is a big problem!!!

What's the point of doing thresholds if you can't do a threshold on %disk space used!!

<groan> The code for the query now uses the script server - so xml, the xml script just returns the total and the used info, not the %used, anybody know how to edit the xml to get it to give %used?

Argon0


Thu Jan 31, 2008 10:45 am
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post 
BTW- sorry for multi-posting just keeping a track of my thoughts....

OK, worked out where the work needs to be done, but haven't a clue how to do it

CactiEZ:
/var/www/html/scripts/ss_host_disk.php

I guess for modularity the scripts have been changed to take arguments to create outputs, but don't know how to use them yet..

What seems to need to happen is for there to be a step or subrouting to take the arguments as they come out for each index item, and calculate the %used from that....

But that is about as far as I can go for the monent, maybe take a look at it agian with a clear head tomorrow...


Thu Jan 31, 2008 11:27 am
User

Joined: Thu Jan 19, 2006 2:59 pm
Posts: 62
Post 
I have this working on my Cacti, but it required a modification to thold...

So you create a CDEF:
Code:
cdef=CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/


which takes a 'used' value, and a 'total' value and produces a 'percentage used' value.

So then you can apply that CDEF to a thold set on the hdd_used value from HOST-MIB.

BUT, for ALL_DATA_SOURCES_NODUPS to work in thold, you need a patch which I just attached here. It modifies thold_functions.php to understand ALL_DATA_SOURCES and ALL_DATA_SOURCES_NODUPS, and also improves the calculation of CDEFs.

Unlike altering the ss_host_disk.php, this has the benefit of working for anything else where you are in the same situation that uses SNMP.

This is working for me on my test server, but obviously, make sure you back up the original thold_functions.php :-)


Attachments:
hj.thold_functions.rpn.all_data_sources.patch.txt [6.5 KiB]
Downloaded 429 times
Sun Feb 03, 2008 12:23 pm
User

Joined: Mon Jan 16, 2006 12:14 pm
Posts: 120
Post 
Cool, thanks, weird thing is I'm sure this used to work...


Wed Feb 13, 2008 10:46 am
New User

Joined: Wed Nov 28, 2007 12:53 pm
Posts: 5
Post displaying the number as percent
this works for me but I would like to generate an error with % sign at the end of the number. Has anybody seen this type of implementation?


Tue Jun 03, 2008 4:34 pm
New User

Joined: Wed Jul 16, 2008 1:56 pm
Posts: 12
Post 
Where does this go in the thold_functions.php file?

top? bottom? replaces it?

THanks.


Fri Jul 18, 2008 3:55 pm
New User

Joined: Wed Jul 16, 2008 1:56 pm
Posts: 12
Post 
Can someone get back to me?

where do i add it in the file?

thanks.


Wed Jul 23, 2008 7:24 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: