Using thold for percentage

Support questions about the Threshold plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
TFC
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Using thold for percentage

#1 Post by TFC » Wed Jun 06, 2018 6:18 am

Hi,
I have cacti 0.8.8.b and Thold 0.5
I use Percentage CDEF to create data. Such as:
cdef=CURRENT_DATA_SOURCE,8,*,CURRENT_DS_MAXIMUM_VALUE,/,100,* (Idon't use |query_ifSpeed| because my interface speed not same as real defined value)

I try to create thold alarm for percentage value like, if traffic in is over than 40% create alarm as warning, and 50% is for critical alarm
https://astdisk.yasar.com.tr/owncloud/p ... 7b3ac1bda4
But I can't create a correct alarm.
For example Output capacitiy :10 Mbps,
Output current value: 3,16 Mpbs
Utilization: 30.83%
But thol alarm is:
Message: ALERT: VKG_Aliaga_SOL - Traffic - Gi0/1 [traffic_out] [traffic_out] is still above threshold of 50 with 1744.8217

What should I do?

slakyari
Posts: 4
Joined: Mon Jul 16, 2018 7:05 am

Re: Using thold for percentage

#2 Post by slakyari » Mon Jul 16, 2018 7:22 am

In Data Type select RPN Expression and paste below.


|ds:traffic_in|,0.000008,*,|query_ifHighSpeed|,/,100,*

This converts traffic_in or traffic_in into MB and then divides with interface speed and then multiply with 100 to get percentage.

User avatar
TFC
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Re: Using thold for percentage

#3 Post by TFC » Tue Jul 17, 2018 3:02 am

Hi,
For outbound traffik thold:
|ds:traffic_out|,0.000008,*,|query_ifHighSpeed|,/,100,*
right?
But there is a problem in calculation I think
My BW is 10 Mbps, so when outbound utilization is 5.4 Mbpsso utilization percentage is 54%
1.jpg
Graphic
1.jpg (10.68 KiB) Viewed 729 times
But thols current value shows 5.4 and it is wrong
2.jpg
Thold current value
2.jpg (5.51 KiB) Viewed 729 times
And my RPN is :

Code: Select all

 |ds:traffic_out|,0.000008,*,|query_ifHighSpeed|,/,100,*
and

Code: Select all

 |ds:traffic_in|,0.000008,*,|query_ifHighSpeed|,/,100,*
This calculation issue is occurs for inbound traffis also.
Is there any idea why it happens? Is it related with 0.000008 ?

netniV
Cacti Guru User
Posts: 3061
Joined: Sun Aug 27, 2017 12:05 am

Re: Using thold for percentage

#4 Post by netniV » Tue Jul 17, 2018 3:31 am

The 0.000008 figure is a conversion between bits, bytes and percentages.

User avatar
TFC
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Re: Using thold for percentage

#5 Post by TFC » Tue Jul 17, 2018 5:23 am

Understand it converts to Mbps in one step. But why value is wrong?

Post Reply