RPN Expression Issues

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
kellyshutt
Posts: 3
Joined: Tue Jul 29, 2014 12:30 pm

RPN Expression Issues

Post by kellyshutt »

I'm trying to make a pretty simple RPN expression and can't get it to do the calculation properly. I keep getting negative numbers and crap like that.

Essentially I'm trying to take multiple data sources and turn them into a percentage value for THOLD.

The "math" expression is basically this:

((a-b-c-d)/a)*100

I've put this through several RPN converters and get this as the expression, but it doesn't work right when I plug into THOLD.

a,b,-,c-,d,-,a,/,100,*

This looks right to me but just does not come out correct at all.

Anyone have any suggestions?

If it helps, I'm using RedHat 6.x package cacti-0.8.8b-5, and then install the settings and thold plugins on top of this.


Peace,
Kelly
kellyshutt
Posts: 3
Joined: Tue Jul 29, 2014 12:30 pm

Re: RPN Expression Issues

Post by kellyshutt »

OK... I figured out some things and have to say I'm disappointed here.

So apparently the older versions of THOLD would associate the template by graph, which allowed you to access any data source for that graph. However, it seems like the latest version associates to specific data sources; so I'm only getting access to one data source instead of all of them.

I turned on some of the debugging in thold_functions.php and I can see that it's not seeing all the data sources, and is instead only pulling the value for the one data source.

It's also using both the new and old value for some reason, which is why the numbers are just coming out crazy. Each time it's essentially using the old value for one part of the RPN and the new value for the other; even though it's actually two different data source names.

Here's my full RPN, and some example output; in this case the 1052340 is old value in the database, and 1055732.1333 is the new value from the current poll.

|ds:mem_total|,|ds:mem_free|,|ds:mem_cache|,|ds:mem_buffers|,-,-,-,|ds:mem_total|,/

07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1055732.1333,1052340,1055732.1333,1055732.1333,-,-,-,1055732.1333,/
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1052340
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] mem_free
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1055732.1333
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1055732.1333
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1055732.1333
07/29/2014 02:31:02 PM - CMDPHP: Poller[0] 1055732.1333

As you can see it's basically just seeing the mem_free data source, which is what I selected when I created the threshold. The new version of THOLD doesn't let me select by graph, only by data source.
kellyshutt
Posts: 3
Joined: Tue Jul 29, 2014 12:30 pm

Re: RPN Expression Issues

Post by kellyshutt »

OH, I see what's going on... The Data Template is only linked to one data source. If I choose something that has a Data Template with multiple data sources on it, such as one of Host MIB templates, it actually works properly.

This is a pain because all the ucd/net ones aren't setup this way.

I guess I'll see about fixing my data templates and see if that works.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests