Threshold with CDEF'd graphs, i.e. Disk space by percentage
Moderators: Developers, Moderators
Re: used space as percentage
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
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
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.
Check out my post, this work and fixes the percentage fight
http://forums.cacti.net/viewtopic.php?t=28156
http://forums.cacti.net/viewtopic.php?t=28156
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
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
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
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
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.
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.
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?
"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?
false positive alarm
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
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
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 ? >_<
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 ? >_<
- Attachments
-
- threshold2.JPG (137.98 KiB) Viewed 7313 times
-
- threshold1.JPG (4.47 KiB) Viewed 7313 times
Who is online
Users browsing this forum: No registered users and 1 guest