[SOLVED] How to use large RPN Expressions in Thold?

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
jchana
Posts: 3
Joined: Wed Jul 04, 2012 5:41 am

[SOLVED] How to use large RPN Expressions in Thold?

Post by jchana »

Hello everyone!
I'am trying to use large RPN expressions in Thold plugin but the plugin truncates it.
Do you know how to allow larger expressions?

Ps:

The RPN Expression i want to use is the following:
|ds:hdd_used|,|ds:hdd_used|,|ds:hdd_free|,+,/,100,*,100,EQ,1,|ds:hdd_used|,|ds:hdd_used|,|ds:hdd_free|,+,/,100,*,0,EQ,1,|ds:hdd_used|,|ds:hdd_used|,|ds:hdd_free|,+,/,100,*,IF,IF

The expression pseudocode is the following:

Code: Select all

used=|ds:hdd_used|;
total=|ds:hdd_used| + |ds:hdd_free|;
percentage = (used/total)*100;
if (percentage == 100)
then
    result = 1
else
    if (percentage == 0)
    then
        result = 1
    else
        result=percentage

return result
Last edited by jchana on Thu Jul 05, 2012 5:03 am, edited 1 time in total.
jchana
Posts: 3
Joined: Wed Jul 04, 2012 5:41 am

Re: How to use large RPN Expressions in Thold?

Post by jchana »

FIXED!

I have fixed the problem and I want to share with you.

There were a maximum length in the expressions. It was 70.
To allow longer RPN expressions you have to alter the database doing the following:

Code: Select all

ALTER TABLE cacti_database_name.thold_data MODIFY expression varchar(255);
ALTER TABLE cacti_database_name.thold_template MODIFY expression varchar(255);
Now you can use expressions up to 255 characters (maximum allowed by mysql varchar type).

Hope this can help you. Best regards!
Nobece
Posts: 4
Joined: Tue Aug 28, 2012 6:19 am
Contact:

Re: [SOLVED] How to use large RPN Expressions in Thold?

Post by Nobece »

Thanks, that post was interesting to me too.
Sponsored articles at http://growposition.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest