FAQFAQ   SearchSearch   RegisterRegister   ProfileProfile   Log inLog in 

THOLD 0.3.9 and HDD percent

 
Post new topic   Reply to topic    CactiUsers.org Forum Index -> Bugs Reports
View previous topic :: View next topic  
Author Message
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Thu Jan 31, 2008 10:13 am    Post subject: THOLD 0.3.9 and HDD percent Reply with quote

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
Back to top
View user's profile Yahoo Messenger MSN Messenger
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Thu Jan 31, 2008 10:19 am    Post subject: Reply with quote

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.
Back to top
View user's profile Yahoo Messenger MSN Messenger
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Thu Jan 31, 2008 10:28 am    Post subject: Reply with quote

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...
Back to top
View user's profile Yahoo Messenger MSN Messenger
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Thu Jan 31, 2008 10:45 am    Post subject: Reply with quote

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
Back to top
View user's profile Yahoo Messenger MSN Messenger
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Thu Jan 31, 2008 11:27 am    Post subject: Reply with quote

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...
Back to top
View user's profile Yahoo Messenger MSN Messenger
Howie
New User


Joined: 19 Jan 2006
Posts: 60

PostPosted: Sun Feb 03, 2008 12:23 pm    Post subject: Reply with quote

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 :-)



hj.thold_functions.rpn.all_data_sources.patch.txt
 Description:

Download
 Filename:  hj.thold_functions.rpn.all_data_sources.patch.txt
 Filesize:  6.5 KB
 Downloaded:  387 Time(s)

Back to top
View user's profile Visit poster's website
argon0
User


Joined: 16 Jan 2006
Posts: 107

PostPosted: Wed Feb 13, 2008 10:46 am    Post subject: Reply with quote

Cool, thanks, weird thing is I'm sure this used to work...
Back to top
View user's profile Yahoo Messenger MSN Messenger
gsaray101
New User


Joined: 28 Nov 2007
Posts: 4

PostPosted: Tue Jun 03, 2008 4:34 pm    Post subject: displaying the number as percent Reply with quote

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?
Back to top
View user's profile
jrego
New User


Joined: 16 Jul 2008
Posts: 12

PostPosted: Fri Jul 18, 2008 3:55 pm    Post subject: Reply with quote

Where does this go in the thold_functions.php file?

top? bottom? replaces it?

THanks.
Back to top
View user's profile
jrego
New User


Joined: 16 Jul 2008
Posts: 12

PostPosted: Wed Jul 23, 2008 7:24 pm    Post subject: Reply with quote

Can someone get back to me?

where do i add it in the file?

thanks.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    CactiUsers.org Forum Index -> Bugs Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Forums Sitemap