Thold precentage limits patch
Moderators: Developers, Moderators
apply my patch from http://forums.cacti.net/viewtopic.php?t=16054
then in the cacti interface click on graph management, then CDEFs
create a new CDEF, I called mine 'Diskspace percentrage'
add 5 items to this CDEF:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Special Data Source: CURRENT_GRAPH_MAXIMUM_VALUE
Item #3 Operator: /
Item #4 Custom String: 100
Item #5 Operator: *
Save it! (how many times I haven't forgotten this after editing a CDEF )
then apply this CDEF to a threshold to test, and if it works apply it to all that you want a percentage monitored from, and apply it to your threshold template.
Good luck.
then in the cacti interface click on graph management, then CDEFs
create a new CDEF, I called mine 'Diskspace percentrage'
add 5 items to this CDEF:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Special Data Source: CURRENT_GRAPH_MAXIMUM_VALUE
Item #3 Operator: /
Item #4 Custom String: 100
Item #5 Operator: *
Save it! (how many times I haven't forgotten this after editing a CDEF )
then apply this CDEF to a threshold to test, and if it works apply it to all that you want a percentage monitored from, and apply it to your threshold template.
Good luck.
it is as it should be. precentage values are converted to digits only during pooling proccess(set $verbose=true in plugins/thold/check-thold.php and manualy run that file from command line - you will see how it works). i've not implemented those conversion functions anywhere else, because no-one requested for it ;]
I did manually run from command line(btw. there isn't variable $verbose, only $debug and $show), that what I'v seen:johnrembo wrote:it is as it should be. precentage values are converted to digits only during pooling proccess(set $verbose=true in plugins/thold/check-thold.php and manualy run that file from command line - you will see how it works). i've not implemented those conversion functions anywhere else, because no-one requested for it ;]
Code: Select all
Checking Threshold : "host - Used Space - /var"
Data Source : hdd_used went above threshold of 100% with 482560000
And those values are far from 100%.
Any ideas why is it being triggered?
hi wwolkers
i had try your method it successfully converted the data size into percentage, but the percentage always 100%, which means the
CURRENT_DATA_SOURCE = CURRENT_GRAPH_MAXIMUM_VALUE
so i remove the CDEF setting, then the thold data became data size again, it shows the used_size
is that mean, the CURRENT_GRAPH_MAXIMUM_VALUE cannot grap the graph value ?
please kindly advise
i had try your method it successfully converted the data size into percentage, but the percentage always 100%, which means the
CURRENT_DATA_SOURCE = CURRENT_GRAPH_MAXIMUM_VALUE
so i remove the CDEF setting, then the thold data became data size again, it shows the used_size
is that mean, the CURRENT_GRAPH_MAXIMUM_VALUE cannot grap the graph value ?
please kindly advise
wwolkers wrote:apply my patch from http://forums.cacti.net/viewtopic.php?t=16054
then in the cacti interface click on graph management, then CDEFs
create a new CDEF, I called mine 'Diskspace percentrage'
add 5 items to this CDEF:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Special Data Source: CURRENT_GRAPH_MAXIMUM_VALUE
Item #3 Operator: /
Item #4 Custom String: 100
Item #5 Operator: *
Save it! (how many times I haven't forgotten this after editing a CDEF )
then apply this CDEF to a threshold to test, and if it works apply it to all that you want a percentage monitored from, and apply it to your threshold template.
Good luck.
- Attachments
-
- with CDEF
- item1.jpg (24.2 KiB) Viewed 4566 times
-
- without CDEF
- item2.jpg (64.21 KiB) Viewed 4566 times
you had to look in patched section, not in beginning of the file:
check the code between "___TPEP BEGIN___" and "___TPEP END___". Shortly it does the following:
if upper_limit(80% for example) contains % sign, then it must be replaced with the following:
Code: Select all
//------------------------------------------------TPEP BEGIN-------------------------------------------//
if ((stristr($item["thold_hi"],"%") or stristr($item["thold_low"],"%"))==true) {
$verbose=true;//info about percentage evaluation proccess (php check-thold.php)
if upper_limit(80% for example) contains % sign, then it must be replaced with the following:
Code: Select all
80%->80*graph_template_upper_limit/100
idle wrote:I did manually run from command line(btw. there isn't variable $verbose, only $debug and $show), that what I'v seen:johnrembo wrote:it is as it should be. precentage values are converted to digits only during pooling proccess(set $verbose=true in plugins/thold/check-thold.php and manualy run that file from command line - you will see how it works). i've not implemented those conversion functions anywhere else, because no-one requested for it ;]I don't see from this how comparison occur...Code: Select all
Checking Threshold : "host - Used Space - /var" Data Source : hdd_used went above threshold of 100% with 482560000
And those values are far from 100%.
Any ideas why is it being triggered?
Code: Select all
Problems THOLD and HPUX ( The values dont match)
Please, when i apply the CDEF "relative percentage" in my treshold i see one message error :
CDEF property not implemented yet: ALL_DATA_SOURCES_NODUPS,
And the values are long number like 1904673.67 and the value correct should be 95.04.
Howto resolve the problem ?
Thanks.
CDEF property not implemented yet: ALL_DATA_SOURCES_NODUPS,
And the values are long number like 1904673.67 and the value correct should be 95.04.
Howto resolve the problem ?
Thanks.
- Attachments
-
- error-THOLD.JPG (99.44 KiB) Viewed 4445 times
Who is online
Users browsing this forum: No registered users and 0 guests