Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Threshold with CDEF'd graphs, i.e. Disk space by percentage
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Threshold)
Author Message
gsaray101
Cacti User


Joined: 17 May 2007
Posts: 108

PostPosted: Tue Jun 03, 2008 4:42 pm    Post subject: Re: used space as percentage Reply with quote

I got this working but I have a little issue. When I receive the alerts, It does not say like 10%. Would it be possible to append % at the end of the number.

My current alert is as follows:

localhost - File System Capacity - /var [hdd_used] is still above threshold of 10 with 52.9116

I would like to see the alerts as:
localhost - File System Capacity - /var [hdd_used] is still above threshold of 10% with 52.9116
Back to top
gab



Joined: 22 Apr 2008
Posts: 6

PostPosted: Wed Jun 11, 2008 2:04 am    Post subject: Reply with quote

You should modified thold_functions.php in the plugins/thold directory.
It's the same function for all the threshold.
So, if an other threshold is in GHz or Go ... it's not a good idea to modify thold_functions.php
Back to top
jjhans



Joined: 03 Jan 2008
Posts: 8

PostPosted: Mon Jun 23, 2008 9:21 am    Post subject: Reply with quote

Here's a thought... these patches seem like a sort of awkward hack... What if the Threshold plugin was modified so that instead of defining a threshold on a data source, you defined it on a graph item? That way, anything that's already being graphed could trivially be thresholded, even if it's a result of a complex CDEF based on multiple data items.
Back to top
redawg



Joined: 30 Mar 2008
Posts: 6

PostPosted: Wed Jul 09, 2008 3:41 pm    Post subject: Reply with quote

Check out my post, this work and fixes the percentage fight

http://forums.cacti.net/viewtopic.php?t=28156
Back to top
jrego



Joined: 14 Jul 2008
Posts: 33

PostPosted: Tue Jul 22, 2008 1:48 pm    Post subject: Reply with quote

OK can someone help me. I think i missed something. here is what i have done.

replaced the thold_functions.php with the one provided.
Then created a CDEF of

CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/

then i applied it to a windows server but i got the following output.
LynnBB - Used Space - C: Label: Seri [hdd_used] 95 n/a 1 0 on 53192925184 yes on
LynnBB - Used Space - E: Label:BBCont [hdd_used] 95 n/a 1 0 on 81900695552 yes on
Back to top
jrego



Joined: 14 Jul 2008
Posts: 33

PostPosted: Tue Jul 22, 2008 1:49 pm    Post subject: Reply with quote

isnt it supposed to do some sort of conversion?

please let me know.

thanks.
Back to top
jrego



Joined: 14 Jul 2008
Posts: 33

PostPosted: Wed Jul 23, 2008 8:11 pm    Post subject: Reply with quote

Can Somone Post the complete instructions in one posting step by step?

Its kindof confusing trying to figure it out..as well as posting the patch file or a new version of the thold_functions.php file.

Also when i go to create the CDEF i dont see an option for CURRENT_DATA_SOURCE. I only see ones for min and max.

Thanks for your help and patience
Back to top
jadus



Joined: 08 Aug 2008
Posts: 3

PostPosted: Fri Aug 08, 2008 12:45 pm    Post subject: Reply with quote

Here's what I did for those looking for a walkthrough:

Download the appropriate patch or PHP file posted by Howie earlier in this thread, and apply/overwrite your current version.

In Cacti, under Graph Management, click CDEFs. Click Add at the top right to create a new one.

Enter the new name as Used/Total > Percentage

Now you want to add the CDEF items in the formula that was posted earlier. It should be like this:
1. Special Data Source/Current Graph Item Data Source
2. Custom String/100
3. Operator/ *
4. Special Data source/All Data sources (Don't include duplicates)
5. Special Data source/Current Graph Item Data Source
6. Operator/ -
7. Operator/ / (division symbol)

Now in your threshold template, under "other setting" you want to select that CDEF.

Those were the steps I followed and it is "mostly" working for me...see next post.
Back to top
jadus



Joined: 08 Aug 2008
Posts: 3

PostPosted: Fri Aug 08, 2008 12:48 pm    Post subject: Reply with quote

I have used the steps posted above, but about twice a day something happens that causes the threshold to be triggered. For example, I just received an email that states the following:

"Server - Used Space - D: Label: Seri [hdd_used] went above threshold of 90 with 152.552"

I have no idea how the value could be 152%, so when I went to look at the threshold under the "Management" interface, it lists current value as 65.0899. However, looking at the thold tab, it displays the incorrect value of 152.552 flagged in red.

This occurs for multiple servers, but only on thresholds created from a template of the "Host MIB - Hard Drive Space".

Usually 5 minutes later there is an email saying the threshold has recovered. Does anyone know why this would happen?
Back to top
gsaray101
Cacti User


Joined: 17 May 2007
Posts: 108

PostPosted: Fri Aug 08, 2008 12:54 pm    Post subject: false positive alarm Reply with quote

Yes I see this problem to on my side. After looking at it little closer, I discovered that sometimes, hdd_total is not poll, thus hdd_used become greater than hdd_total and this results in a number greater than 100.

In order to get around it, I created another cdef function to toss out numbers greater than 100, but according to some people in this form, threshold only supports *,+,- and / so my cdef is inaccurate. In order to fix it, threshold needs to include all of the cdef functionality. Can anybody help out with that?

my cdef function is:

Special Data Source: CURRENT_DATA_SOURCE
Custom String: 100
Operator: *
Special Data Source: ALL_DATA_SOURCES_NODUPS
Special Data Source: CURRENT_DATA_SOURCE
Operator: -
Operator: /
Custom String: 100
Function: GT
Function: UNKN
Special Data Source: CURRENT_DATA_SOURCE
Custom String: 100
Operator: *
Special Data Source: ALL_DATA_SOURCES_NODUPS
Special Data Source: CURRENT_DATA_SOURCE
Operator: -
Operator: /
Function: IF
Back to top
juge



Joined: 12 Aug 2008
Posts: 4

PostPosted: Tue Aug 12, 2008 2:24 pm    Post subject: Reply with quote

Hello, I have been able to follow Howie's advices and patch. It is almost working, but I have a singuliar problem:
1- percentage is shown when accessing thold configuration page for the ds
2- for the main thold page, only -100 are shown, I am very amazed

I tried to debug, and understand why, and locate the differences, but I lack something.

my version of cacti (0.8.7b-2.1) is the last, debian style, I patched manually with PA (2.1), is the last, (patched ok, but had to do it with my bare hands all alone old fashion style), and last version of thold (0.3.9). As anyone an idea where I can look in the code for an answer ? >_<



threshold1.JPG
 Description:
 Filesize:  4.47 KB
 Viewed:  1024 Time(s)

threshold1.JPG



threshold2.JPG
 Description:
 Filesize:  137.98 KB
 Viewed:  1024 Time(s)

threshold2.JPG


Back to top
juge



Joined: 12 Aug 2008
Posts: 4

PostPosted: Thu Aug 14, 2008 4:43 am    Post subject: Reply with quote

I have been able to identify the problem, the ALL_DATA_SOURCES_NODUPS variable is ok only on the configuration page of the threshold, not when updating the mysql database (in my case).

I tried Redawg patch, adding a hdd_percent variable in the rrd, and this is ok now. thanks.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Threshold) All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 



Powered by phpBB © 2001, 2005 phpBB Group