Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 21, 2018 7:20 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Can Cacti branch Github admin look into reported bugs please
PostPosted: Mon Jun 19, 2017 2:33 pm 
Offline
Cacti User

Joined: Thu Jan 21, 2010 8:41 pm
Posts: 162
Guys, I have opened 4 cases in GitHub under Thold, describing THOLD bugs discovered by me. Can someone like Cigamit work with me on resolving these issues. I would love to provide testing and feedback in timely manner.


Attachments:
File comment: Open bugs.
github.jpeg
github.jpeg [ 124.54 KiB | Viewed 1537 times ]
Top
 Profile  
 
 Post subject: Re: Can Cacti branch Github admin look into reported bugs pl
PostPosted: Fri Jun 23, 2017 10:59 am 
Offline

Joined: Thu Mar 23, 2017 4:56 pm
Posts: 7
Hi thold developers,

For me it looks thold lost kind of synchronization with Cacti:

For example, if we configure few thold templates for one data template then thold will be created for the only last one in XXXh data template

mysql> SELECT tt.data_template_id, tt.id
-> FROM thold_template AS tt
-> INNER JOIN plugin_thold_host_template AS ptht
-> ON tt.id=ptht.thold_template_id
-> WHERE ptht.host_template_id = 5;
+------------------+----+
| data_template_id | id |
+------------------+----+
| 38 | 4 |
| 38 | 5 |
| 38 | 3 |
| 60 | 21 |
| 41 | 16 |
| 41 | 15 |
| 27 | 7 |
| 49 | 8 |
| 38 | 6 |
+------------------+----+
9 rows in set (0.01 sec)

Probably problem somewhere in array_rekey() which will return only (60/21; 41/15; 27/7; 49,8; 38,6)

After that auto creation will start to create tholds for XXXh one template for anyone for localhost!!!:

Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'errors_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'int_status'
Created threshold for the Graph 'XXX-C2A-SRV - Traffic - Te1/0/24 (XXX-C2A-MEZZANINE Te1/0/1 TRENDME)' using the Data Source 'traffic_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source '5min_cpu'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'poolUsed'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'errors_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'int_status'
Created threshold for the Graph 'XXX-C2A-SRV - Traffic - Te9/0/22 (XXX-C2A-STAGE-A Te8/0/1 TRENDME)' using the Data Source 'traffic_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source '5min_cpu'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'poolUsed'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'errors_out'
Created threshold for the Graph 'XXX-C2A-SRV - Status - Te1/0/22 (XXX-C2A-STAGE-A Te1/0/1 TRENDME)' using the Data Source 'int_status'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'traffic_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source '5min_cpu'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'poolUsed'
Created threshold for the Graph 'XXX-C2A-SRV - Errors - Te1/0/22 (XXX-C2A-STAGE-A Te1/0/1 TRENDME) ' using the Data Source 'errors_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'int_status'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'traffic_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source '5min_cpu'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'poolUsed'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'errors_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source 'int_status'
Created threshold for the Graph 'XXX-C2A-SRV - Traffic - Te1/0/22 (XXX-C2A-STAGE-A Te1/0/1 TRENDME)' using the Data Source 'traffic_out'
Created threshold for the Graph 'XXX-NETADMIN (localhost) - Load Average' using the Data Source '5min_cpu'
...

And then when you take a list in of thold in GUI it will clean up thold for localhost.
Probably it is the reason why numbers of created tholds are not consiquent when you look on them.

Section of cli_thresholds.php for creating particular graph template absent at all.

I am not a programmer. I can see some problems here, but unfortunately, I am not able to correct it


Top
 Profile  
 
 Post subject: Re: Can Cacti branch Github admin look into reported bugs pl
PostPosted: Wed Jun 28, 2017 11:35 pm 
Offline

Joined: Thu Mar 23, 2017 4:56 pm
Posts: 7
I created patch wich looks resolved a couple of my problems (probably it covers bugs #92 and #93):

Will check what else can do

Code:
--- /usr/share/cacti/plugins/thold/thold_functions.php.orig     2017-06-28 21:21:35.513491692 -0700
+++ /usr/share/cacti/plugins/thold/thold_functions.php  2017-06-28 21:23:17.683561146 -0700
@@ -3314,14 +3314,14 @@
                FROM thold_template AS tt
                INNER JOIN plugin_thold_host_template AS ptht
                ON tt.id=ptht.thold_template_id
-               WHERE ptht.host_template_id = ?', array($host_template_id)), 'data_template_id', 'id');
+               WHERE ptht.host_template_id = ?', array($host_template_id)), 'id', 'data_template_id');

        if (!sizeof($template_list)) {
                $_SESSION['thold_message'] = '<font size=-2>' . __('No Thresholds Templates associated with the Host\'s Template.') . '</font>';
                return 0;
        }

-       foreach($template_list as $data_template_id => $thold_template_id) {
+       foreach($template_list as $thold_template_id => $data_template_id) {
                $data_templates[$data_template_id] = $data_template_id;
                $thold_template_ids[$thold_template_id] = $thold_template_id;
        }
@@ -3359,7 +3359,7 @@
                                                WHERE local_data_id = ?
                                                AND data_source_name = ?
                                                ORDER BY id LIMIT 1', array($local_data_id, $template['data_source_name']));
-
+if("" != $data_template_rrd_id) {
                                        $graph  = db_fetch_row_prepared('SELECT local_graph_id, graph_template_id
                                                FROM graph_templates_item
                                                WHERE task_item_id = ?
@@ -3439,6 +3439,7 @@
                                                        $created++;
                                                }
                                        }
+}
                                }
                        }
                }


Top
 Profile  
 
 Post subject: Re: Can Cacti branch Github admin look into reported bugs pl
PostPosted: Sun Jul 09, 2017 6:05 pm 
Offline
Cacti User

Joined: Thu Jan 21, 2010 8:41 pm
Posts: 162
Glass17, thank you so much for your patch work, I was able to successfully test it and YES it definitely resolves issues reported in #92 and #93
Now question becomes how to incorporate your changes in thold github!
I will do my best to "alert them" of required changes.


Top
 Profile  
 
 Post subject: Re: Can Cacti branch Github admin look into reported bugs pl
PostPosted: Tue Jul 18, 2017 5:25 pm 
Offline

Joined: Thu Mar 23, 2017 4:56 pm
Posts: 7
One more patch which is solving for me the issue with reapplying suggested names:

Code:
--- /usr/share/cacti/plugins/thold/thold.php.orig       2017-07-18 12:38:14.106184521 -0700
+++ /usr/share/cacti/plugins/thold/thold.php    2017-07-18 12:40:02.645261122 -0700
@@ -254,7 +254,7 @@
                                                        array($thold['thold_template_id']));

                                                $name = thold_format_name($template, $thold['local_graph_id'],
-                                                       $thold['data_template_rrd_id'], $template['data_source_name']);
+                                                       $thold['local_data_id'], $template['data_source_name']);

                                                plugin_thold_log_changes($del, 'reapply_name', array('id' => $del));



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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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:  

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