Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Mar 20, 2019 8:53 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: 'Thold' does not appear in templates
PostPosted: Wed Mar 14, 2018 1:08 pm 
Offline
User avatar

Joined: Fri Sep 19, 2014 3:33 am
Posts: 21
Location: Sofia, Bulgaraia
The plugin...

Code:
# ls -alh
total 628K
drwxrwxr-x 8 apache apache 4.0K Mar 14 15:42 ./
drwxrwxr-x 3 apache apache 4.0K Mar 14 18:56 ../
-rw-r--r-- 1 apache apache 1.1K Mar 14 03:59 .travis.yml
-rw-r--r-- 1 apache apache  16K Mar 14 03:59 CACTI-THOLD-MIB
-rw-r--r-- 1 apache apache  233 Mar 14 15:42 INFO
-rw-r--r-- 1 apache apache  26K Mar 14 03:59 LICENSE
-rw-r--r-- 1 apache apache  22K Mar 14 03:59 README.md
-rw-r--r-- 1 apache apache 5.6K Mar 14 03:59 cli_thresholds.php
drwxr-xr-x 2 apache apache 4.0K Mar 14 03:59 extras/
drwxr-xr-x 2 apache apache 4.0K Mar 14 03:59 images/
drwxr-xr-x 2 apache apache 4.0K Mar 14 03:59 includes/
-rw-r--r-- 1 apache apache   41 Mar 14 03:59 index.php
drwxr-xr-x 4 apache apache 4.0K Mar 14 03:59 locales/
-rw-r--r-- 1 apache apache  64K Mar 14 03:59 notify_lists.php
drwxr-xr-x 3 apache apache 4.0K Mar 14 03:59 service/
-rw-r--r-- 1 apache apache  54K Mar 14 03:59 setup.php
drwxr-xr-x 5 apache apache 4.0K Mar 14 03:59 themes/
-rw-r--r-- 1 apache apache  66K Mar 14 03:59 thold.php
-rw-r--r-- 1 apache apache  12K Mar 14 03:59 thold_daemon.php
-rw-r--r-- 1 apache apache  277 Mar 14 03:59 thold_daemon.service
-rw-r--r-- 1 apache apache 155K Mar 14 03:59 thold_functions.php
-rw-r--r-- 1 apache apache  47K Mar 14 03:59 thold_graph.php
-rw-r--r-- 1 apache apache  11K Mar 14 03:59 thold_process.php
-rw-r--r-- 1 apache apache  63K Mar 14 03:59 thold_templates.php
-rw-r--r-- 1 apache apache  18K Mar 14 03:59 thold_webapi.php


Top
 Profile  
 
 Post subject: Re: 'Thold' does not appear in templates
PostPosted: Wed Mar 14, 2018 1:41 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2256
What does MySQL? Try doing SELECT * FROM plugin_configs;

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: 'Thold' does not appear in templates
PostPosted: Wed Mar 14, 2018 4:14 pm 
Offline
User avatar

Joined: Fri Sep 19, 2014 3:33 am
Posts: 21
Location: Sofia, Bulgaraia
Well, I found the time to debug this. I added trace messages into plugins.php as suggested (see my changes on GitHub). And after spending some time adding and adding trace messages, I finally got to this (which comes to confirm there is no problem with permissions):

Code:
2018-03-14 22:40:30.46520:DEBUG: Enter plugins.php
2018-03-14 22:40:30.47262:DEBUG: Enter retrieve_plugin_list()
2018-03-14 22:40:30.47399:DEBUG: Plugin dir: thold2018-03-14 22:40:30.47416:DEBUG: Exit retrieve_plugin_list()
2018-03-14 22:40:30.52617:DEBUG: Enter update_show_current()
2018-03-14 22:40:30.52688:DEBUG: Enter plugins_load_temp_table()
2018-03-14 22:40:30.52701:DEBUG: table = plugin_temp_table_359531876
2018-03-14 22:40:30.53951:DEBUG: path = /var/www/htdocs/stats/cacti/plugins/
2018-03-14 22:40:30.53978:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/'
2018-03-14 22:40:30.53994:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/..'
2018-03-14 22:40:30.54009:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/thold'
2018-03-14 22:40:30.54028:DEBUG: Is directory '/var/www/htdocs/stats/cacti/plugins/thold'
2018-03-14 22:40:30.54040:DEBUG: Found /var/www/htdocs/stats/cacti/plugins/thold/INFO
2018-03-14 22:40:30.54117:DEBUG: status = 0
2018-03-14 22:40:30.54310:DEBUG: exists = false
2018-03-14 22:40:30.54328:DEBUG: INSERT INTO plugin_temp_table_359531876 (directory, name, status, author, webpage, version, requires, infoname) VALUES (thold, Thresholds, 0, The Cacti Group, http://www.cacti.net, 1.0.4, , thold)
2018-03-14 22:40:30.54514:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/index.php'
2018-03-14 22:40:30.54532:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/.'
2018-03-14 22:40:30.54546:DEBUG: Closing '/var/www/htdocs/stats/cacti/plugins/'
2018-03-14 22:40:30.54557:DEBUG: Exit plugins_load_temp_table()
2018-03-14 22:40:30.54567:DEBUG: table = plugin_temp_table_359531876
2018-03-14 22:40:30.54682:DEBUG: SELECT count(*) FROM plugin_temp_table_359531876
2018-03-14 22:40:30.54857:DEBUG: total_rows =
2018-03-14 22:40:30.54888:DEBUG: SELECT * FROM plugin_temp_table_359531876  ORDER BY `name` ASC  LIMIT 0,50
2018-03-14 22:40:30.55181:DEBUG: Plugins count = 0
2018-03-14 22:40:30.55210:DEBUG: Exit update_show_current()
2018-03-14 22:40:30.56745:DEBUG: Exit plugins.php


Hint: Notice the values of total_rows and Plugins count above.

This puzzled me for a few minutes until I realized that the temporary table is just not created. Which made me check cacti user's permissions into the database (I'm using MySQL 5.7.21 BTW) and bingo CREATE TEMPORARY TABLES permission was not granted. I do not remember and cannot say why so, but I'm using this installation for about 10 years and as I mentioned already apparently by now I haven't used any plugins (shame on me).

Conclusion: Cacti plugins cannot be loaded from /plugins/ folder unless cacti's database user has CREATE TEMPORARY TABLES privilege granted (see CREATE TEMPORARY TABLE Syntax). Thus, in my case the solution was to execute the following:

Code:
GRANT CREATE TEMPORARY TABLES ON cacti.* TO 'cacti'@'localhost';


Note: If PHP is configured to use persistent connections then this won't take effect until new connection is used (or httpd or mysql are restarted).

So this was my problem. However, I think this could be better handled into plugins.php, because CREATE TEMPORARY TABLE would raise
Code:
ERROR 1044 (42000): Access denied for user 'cacti'@'localhost' to database 'cacti'
if CREATE TEMPORARY TABLES privilege is not granted. I'm not that familiar with Cacti's sources, but I think plugins.php doesn't write any debug even this is enabled in Settings.


Top
 Profile  
 
 Post subject: Re: 'Thold' does not appear in templates
PostPosted: Wed Mar 14, 2018 4:32 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2256
Thanks for that breakdown. I think it may be worth getting the installer to check for that by trying to create a temporary table. Since you are already on GitHub, can you create an issue for it at https://github.com/cacti/cacti/issues/ with your above findings and I'll put my comments then apply a fix. :)

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: 'Thold' does not appear in templates
PostPosted: Thu Mar 15, 2018 8:22 am 
Offline
User avatar

Joined: Fri Sep 19, 2014 3:33 am
Posts: 21
Location: Sofia, Bulgaraia
netniV wrote:
Since you are already on GitHub, can you create an issue for it at https://github.com/cacti/cacti/issues/ with your above findings and I'll put my comments then apply a fix. :)


I just create issue #1474 in GitHub. Thank you and let me know if any help necessary.


Top
 Profile  
 
 Post subject: Re: [SOLVED] Plugins not showing within cacti
PostPosted: Thu Mar 15, 2018 8:27 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2256
Thanks for that. I've marked this as solved and amend the title slightly since it wasn't specific to thold but the any plugin.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: [SOLVED] Plugins not showing within cacti
PostPosted: Fri Mar 16, 2018 12:35 pm 
Offline

Joined: Thu Mar 08, 2018 12:31 pm
Posts: 2
Ok, I finally got it working. I've uninstall/remove the thold plugin completely from/usr/share/cacti/plugins directory. Get a fresh copy from Github ( git clone https://github.com/Cacti/plugin_thold ) to the plugins directory. Be sure to rename the directory to thold. Install and activate thold from the Configuration---->Plugins Management left navigation bar from the Cacti GUI.

[[email protected] plugins]# ls -ls
total 8
4 -rw-r--r-- 1 root root 40 Feb 25 17:12 index.php
4 drwxr-xr-x 9 root root 4096 Mar 16 08:41 thold
[[email protected] plugins]# pwd
/usr/share/cacti/plugins
[[email protected] plugins]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[[email protected] plugins]#


Top
 Profile  
 
 Post subject: Re: [SOLVED] Plugins not showing within cacti
PostPosted: Sat Mar 17, 2018 3:51 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2256
When using GIT to clone the cacti plugins, always specify the extra parameter for directory name:
Code:
git clone https://github.com/cacti/plugin_thold thold

That last "thold" automatically names the folder used by git so you don't have to rename later. The same applies for some other users plugins (network-weathermap is actually just weathermap). Best way to be sure, check the INFO file within the plugin folder.

Starting with 1.2.x, the plugin management system will actually warn you that the folder name is wrong to be more helpful :)

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: [SOLVED] Plugins not showing within cacti
PostPosted: Tue Oct 02, 2018 6:45 am 
Offline

Joined: Tue Oct 02, 2018 6:18 am
Posts: 1
Hello all,
I'm using cacti version 1.1.38
I installed thold plugin and I got the plugin infos from http://<cacti_url>/plugins.php but I can't get it from my TAB menu so I don't know where to configure the plugin so I can use it.

any idea of the problem?

thank you


Attachments:
thold.png
thold.png [ 64.47 KiB | Viewed 196 times ]
Top
 Profile  
 
 Post subject: Re: [SOLVED] Plugins not showing within cacti
PostPosted: Tue Oct 02, 2018 3:00 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2256
Yes. You need to add it to your account as a permission under Settings -> Users or Settings -> Groups

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 9 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:  

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