Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun Feb 18, 2018 6:46 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [Error] Threshold 100G Interface
PostPosted: Thu May 12, 2016 10:08 am 
Offline

Joined: Thu May 12, 2016 5:55 am
Posts: 1
Congratulations for this fantastic software.

I have a Threshold applied on a 100Gbps interface, to alert me when the total traffic, reaches 15% and 17% of their capacity.

The threshold works fine until the traffic of the interface reaches a little more than 34Gbps, and return to normal values when the traffic return below 34Gbps.

To find the percentage of utilization a have the following RPN Expression: “|ds:traffic_in|,8,*,1000000,/,|query_ifHighSpeed|,/,100,*”

In the image attached is an example of the breach. The “Current value” in the image are in Bytes.

Before reaches 34Gbps: Current Value = 3 351 335 882.2 Bytes = 26.8107Gbps
After reaches 34Gbps: Current Value = 4 863 133 878.5 Bytes = 38.9051Gbps

Any help would be appreciated.

Operating System : Unix
Webserver : Apache
Cacti : 0.8.8g
Spine : 0.8.8f
MySQL : 5.5.47-0+deb7u1 (Debian)
PHP : 5.4.45-0+deb7u2
RRDTool : 1.5.5
Net-SNMP : 5.4.3
Plugin Architecture : 3.1
Plugins Instaled
Autom8 : 0.31
Aggregate : 1.01
Settings : 0.71
Discovery : 1.5
Weathermap : 0.97b
Realtime : 0.5
Spikekill : 1.3
Thold : 0.5


Attachments:
Before and After 34Gbps.png
Before and After 34Gbps.png [ 13.08 KiB | Viewed 3438 times ]
Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Wed Nov 16, 2016 7:38 pm 
Offline

Joined: Fri Apr 19, 2013 4:38 am
Posts: 4
I appear to have the same issue with monitoring interfaces that go above 34Gbps, both physical 100G interfaces and aggregates. Setting up baseline monitoring to alert on percentage changes things work fine at low bandwidth but the figure for the current value reported goes out of whack over 34Gbps.

The attached shows the odd figure for the current value as well as the accurate +/- percentage values that are to be alerted on, so I'm unsure as to why thold is accurately calculating the +/- % values with showing an inaccurate current value. Any help would be greatly appreciated.


Attachments:
thold123.jpg
thold123.jpg [ 30.03 KiB | Viewed 2013 times ]
Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Thu Nov 17, 2016 5:28 pm 
Offline

Joined: Fri Apr 19, 2013 4:38 am
Posts: 4
There's a section of the thold_get_currentval function in thold_functions.php that looks to be causing this for me -

/* assume counter reset if greater than max value */
if ($t_item['rrd_maximum'] > 0 && $currentval > $t_item['rrd_maximum']) {
$currentval = $item[$t_item['name']] / $polling_interval;
}elseif ($t_item['rrd_maximum'] == 0 && $currentval > 4.25E+9) {
$currentval = $item[$t_item['name']] / $polling_interval;
}

Commenting this section out has resolved my issue for the moment, although currently not sure if it's a valid long term solution.


Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Thu May 11, 2017 11:16 am 
Offline

Joined: Wed Jul 20, 2011 1:42 pm
Posts: 2
Location: Brazil
Problem is counter interfaces 32 bits and interface counter 64 bits overflow add variable $icounter
Put the variable a to differentiate.

if ($item[$thold_data['name']] >= $thold_data['oldvalue']) {
// Everything is normal
$currentval = $item[$thold_data['name']] - $thold_data['oldvalue'];
} else {
// Possible overflow, see if its 32bit or 64bit
if ($thold_data['oldvalue'] > 4294967295) {
$currentval = (18446744073709551615 - $thold_data['oldvalue']) + $item[$thold_data['name']];
$icounter = 64; // is counter 64bits
} else {
$currentval = (4294967295 - $thold_data['oldvalue']) + $item[$thold_data['name']];
$icounter = 32; // is counter 32bits
}
}

$currentval = $currentval / $polling_interval;

plugin_log("NOTE COUNTER: '$currentval'", false, "THOLD");

/* assume counter reset if greater than max value */
if ($thold_data['rrd_maximum'] > 0 && $currentval > $thold_data['rrd_maximum']) {
$currentval = $item[$thold_data['name']] / $polling_interval;
}elseif ($thold_data['rrd_maximum'] == 0 && $currentval > 4.25E+9 && $icounter == 32) {
$currentval = $item[$thold_data['name']] / $polling_interval;
}

_________________
MOTTAMOURA


Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Mon May 15, 2017 12:57 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 565
Can you create a pull request for that into GitHub? Also, please insure that the max values in your RRDfiles are correct. You may be overflowing your RRDfile.

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Mon Jan 15, 2018 5:23 am 
Offline

Joined: Tue Oct 31, 2017 8:25 am
Posts: 7
I have had similar problem. The main issue was, that the condition in elsif >> }elseif ($thold_data['rrd_maximum'] == 0 && $currentval > 4.25E+9) { << was resolved like true >>
}elseif (|query_ifSpeed| == 0 && 4264205114.9701 > 4.25E+9) { <<. Yes, condition >> |query_ifSpeed| == 0 << is really true.

The variable $thold_data['rrd_maximum'] is filled from select (thold_functions.php line 671):
SELECT thold_data.id, thold_data.local_graph_id, thold_data.percent_ds, thold_data.expression, thold_data.data_type, thold_data.cdef, thold_data.local_data_id, thold_data.data_template_rrd_id, thold_data.lastread, UNIX_TIMESTAMP(thold_data.lasttime) AS lasttime, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id, data_template_data.rrd_step, data_template_rrd.rrd_maximum FROM thold_data LEFT JOIN data_template_rrd ON data_template_rrd.id = thold_data.data_template_rrd_id LEFT JOIN data_template_data ON data_template_data.local_data_id=thold_data.local_data_id limit 100;

where I have sometimes "|query_ifSpeed|" parameter and sometimes number parameter (depends on Data Source configuration).

I resoved it with this change 2x= on 3x= in condition >> }elseif ($thold_data['rrd_maximum'] === 0 && $currentval > 4.25E+9) { << and testing the data type also.


Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Mon Jan 15, 2018 7:44 am 
Offline
Cacti User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 446
I presume this is within the thold_get_currentval function? Can you put a full copy of that function that you have in code blocks so I can take a look and compare to the current live one?

_________________
Cacti Resources:
Cacti Website
Cacti Issues
Cacti Releases

My resources:
How to submit Pull Requests
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: [Error] Threshold 100G Interface
PostPosted: Wed Jan 17, 2018 3:28 am 
Offline

Joined: Tue Oct 31, 2017 8:25 am
Posts: 7
Hello netniV, you are right. The mentioned function is below. (We use thold in version 1.0.3.)

Code:
function thold_get_currentval(&$thold_data, &$rrd_reindexed, &$rrd_time_reindexed, &$item, &$currenttime) {
   /* adjust the polling interval by the last read, if applicable */
   $currenttime = $rrd_time_reindexed[$thold_data['local_data_id']];
   if ($thold_data['lasttime'] > 0) {
      $polling_interval = $currenttime - $thold_data['lasttime'];
   } else {
      $polling_interval = $thold_data['rrd_step'];
   }

   if (empty($polling_interval)) {
      $polling_interval = read_config_option('poller_interval');
   }

   $currentval = 0;

   if (isset($rrd_reindexed[$thold_data['local_data_id']])) {
      $item = $rrd_reindexed[$thold_data['local_data_id']];
      if (isset($item[$thold_data['name']])) {
         switch ($thold_data['data_source_type_id']) {
         case 2:   // COUNTER
            if ($thold_data['oldvalue'] != 0) {
               if ($item[$thold_data['name']] >= $thold_data['oldvalue']) {
                  // Everything is normal
                  $currentval = $item[$thold_data['name']] - $thold_data['oldvalue'];
               } else {
                  // Possible overflow, see if its 32bit or 64bit
                  if ($thold_data['oldvalue'] > 4294967295) {
                     $currentval = (18446744073709551615 - $thold_data['oldvalue']) + $item[$thold_data['name']];
                  } else {
                     $currentval = (4294967295 - $thold_data['oldvalue']) + $item[$thold_data['name']];
                  }
               }

               $currentval = $currentval / $polling_interval;

               /* assume counter reset if greater than max value */
               if ($thold_data['rrd_maximum'] > 0 && $currentval > $thold_data['rrd_maximum']) {
                  $currentval = $item[$thold_data['name']] / $polling_interval;
               }elseif ($thold_data['rrd_maximum'] === 0 && $currentval > 4.25E+9) {
                  $currentval = $item[$thold_data['name']] / $polling_interval;
               }
               
            } else {
               $currentval = 0;
            }
            break;
         case 3:   // DERIVE
            $currentval = ($item[$thold_data['name']] - $thold_data['oldvalue']) / $polling_interval;
            break;
         case 4:   // ABSOLUTE
            $currentval = $item[$thold_data['name']] / $polling_interval;
            break;
         case 1:   // GAUGE
         default:
            $currentval = $item[$thold_data['name']];
            break;
         }
      }
   }

   return $currentval;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group