Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When plugin exceed runtimes, they should not be automatic disabled #4618

Closed
bentech4u opened this issue Nov 29, 2021 · 34 comments
Closed

When plugin exceed runtimes, they should not be automatic disabled #4618

bentech4u opened this issue Nov 29, 2021 · 34 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@bentech4u
Copy link

HI

i have installed plugin and it was working perfectly. But every day it is disabling automatically

Cacti Version 1.2.19
Cacti OS unix
NET-SNMP Version NET-SNMP version: 5.8
RRDtool Version Configured 1.7.0+
RRDtool Version Found 1.7.0
@cigamit
Copy link
Member

cigamit commented Nov 29, 2021

Not enough info. What plugin version? Have you tried the latest dev version of the plugin? What error is it displaying in the logs?

@bentech4u
Copy link
Author

Plugin version is 1.5.2

@bentech4u
Copy link
Author

2021-11-28 19:01:59 - ERROR PHP ERROR in Plugin 'thold': Maximum execution time of 59 seconds exceeded in file: /var/www/html/cacti/plugins/thold/includes/polling.php on line: 285
2021-11-28 19:01:59 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'thold'

@c0sm1n
Copy link

c0sm1n commented Nov 29, 2021

I'm seeing the same thing with thold 1.5.3 in cacti version 1.2.16

ERROR PHP ERROR in Plugin 'thold': Maximum execution time of 299 seconds exceeded in file: /opt/www/cacti/plugins/thold/includes/polling.php on line: 45
CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'thold'

@bmfmancini
Copy link
Member

bmfmancini commented Nov 29, 2021 via email

@c0sm1n
Copy link

c0sm1n commented Dec 2, 2021

Nothing around the time when the plugin times out and is disabled

@iskandarbasman
Copy link

iskandarbasman commented Dec 15, 2021

Not enough info. What plugin version? Have you tried the latest dev version of the plugin? What error is it displaying in the logs?

I did an upgrade on my test cacti and I saw this log
2021-12-15 09:43:11 - CMDPHP Disabling thold version 1.6 as it is not compatible with Cacti 1.2.19

What is is supported version of THOLD for cacti version 1.2.19.
Only Develop version of THOLD ?

@iskandarbasman
Copy link

Just installed the develop version of THOLD from a manual download on github.

image

Assume we can going to hit into issue with cacti version 1.2.19 since the version number for the current THOLD Develop version is still 1.6.

@TheWitness
Copy link
Member

No, you would not be able to install otherwise.

@iskandarbasman
Copy link

No, you would not be able to install otherwise.

Yeah... Only getting that error when upgrading cacti.

@TheWitness
Copy link
Member

If you look at the INFO file, you only need to be at 1.2.16++ to use thold 1.6. You may have a PHP version that is too high, but that error would not show up if that was the case. I've not done anything on thold in a while. I know that there are a number of bugs out there. Timing is a bitch.

@netniV
Copy link
Member

netniV commented Feb 4, 2022

This message appears under during an upgrade of Cacti when each plugin is checked where its status is installed or enabled and assumed needs disabling unless it meets all of the following criteria:

  • It must exist under the plugins directory with the same name as the plugin
  • It must not be a plugin that has been integrated
  • It must have file setup.php in the plugin's root directory
  • It must have file INFO in the plugin's root directory
  • It must have a compat entry under the info section within the INFO file
  • It must have a version that is not less than the current cacti version

If ANY of that criteria fails, the problem will be disabled. It may be worth adding a screen that warns about plugins being disabled but if we do that will be for 1.2.21 and above.

@bentech4u
Copy link
Author

HI

Still facing issues of disabling Thold plugin. Did anyone fixed this ?

[info] name = thold version = 1.5.2 longname = Thresholds author = The Cacti Group email = homepage = http://www.cacti.net compat = 1.2.3 capabilities = online_view:1, online_mgmt:1, offline_view:0, offline_mgmt:0, remote_collect:1

@TheWitness
Copy link
Member

You need to provide more information. When Cacti disables a plugin, it logs not only that fact, but it registers a backtrace in the log file that indicated the function call that caused it and the line numbers involved. We need that information along with your Cacti version.

@bentech4u
Copy link
Author


Cacti Version 1.2.19
Cacti OS unix
NET-SNMP Version NET-SNMP version: 5.8
RRDtool Version Configured 1.7.0+
RRDtool Version Found 1.7.0

cacti.log-20220313:94114:2022-03-13 20:36:09 - ERROR PHP ERROR in Plugin 'thold': Maximum execution time of 59 seconds exceeded in file: /var/www/html/cacti/plugins/thold/includes/polling.php on line: 276

cacti.log-20220313:94116:2022-03-13 20:36:09 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'thold'

@TheWitness
Copy link
Member

Well that's not supposed to happen.

@TheWitness TheWitness changed the title Plugin disabled automatically on cacti release 1.2.19 Plugins automatically disabled on cacti release when they exceed their maximum allowed runtime Mar 14, 2022
@TheWitness
Copy link
Member

Moving this issue as it's a Cacti issue.

@TheWitness
Copy link
Member

Please refer to this issue going forward. I have transferred it to the Cacti side.

#4619

@TheWitness TheWitness transferred this issue from Cacti/plugin_thold Mar 14, 2022
@TheWitness
Copy link
Member

Second question.

How big is the install?

  • Number of devices?
  • Number of data sources?
  • Poller Frequency (aparently 60 seconds)?

@bentech4u
Copy link
Author

Number of devices?
(A) - 69
Number of data sources?
(A) above 2000
Poller Frequency (aparently 60 seconds)?
(A)
Poller Type - Spine
Poller Sync Interval - every 30 minutes
Poller Interval - every minute
Cron/Daemon Interval - every minute

@TheWitness
Copy link
Member

So, how often is it happening? We have an idea of what is causing it, but need further clarification.

TheWitness added a commit that referenced this issue Mar 14, 2022
Plugins automatically disabled on cacti release when they exceed their maximum allowed runtime
@TheWitness
Copy link
Member

Okay, it should be fixed now. Just a simple one line change to lib/functions.php.

@TheWitness TheWitness added bug Undesired behaviour resolved A fixed issue labels Mar 14, 2022
@TheWitness TheWitness added this to the v1.2.20 milestone Mar 14, 2022
@bentech4u
Copy link
Author

Every day ,

what i need to add in lib/functions.php

@TheWitness
Copy link
Member

Review the commit.

@TheWitness
Copy link
Member

Click on "Fixing..."

image

@bentech4u
Copy link
Author

ok, thanks for the help, i have added that line in functions.php

@bentech4u
Copy link
Author

HI, i have checked today and it's disabled again.

@bentech4u
Copy link
Author

this is happened yesterday night and more than 16 hours it was enabled,

image

@TheWitness
Copy link
Member

Get us the backtraces.

@bentech4u
Copy link
Author

do i need to update full logs or below is enough?

2022-03-17 11:18:14 - SYSTEM THOLD DAEMON STATS: TotalTime:0.000 MaxRuntime:0.000 Processed:0 InProcess:1 TotalDevices:70 DownDevices:1 NewDownDevices:0 MaxProcesses:1 Completed:0 Running:0 Broken:0
2022-03-17 11:34:50 - ERROR PHP ERROR in  Plugin 'thold': Maximum execution time of 299 seconds exceeded in file: /var/www/html/cacti/plugins/thold/includes/polling.php on line: 275
2022-03-17 11:34:50 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'thold'
2022-03-17 12:02:53 - ERROR PHP ERROR in  Plugin 'thold': Maximum execution time of 299 seconds exceeded in file: /var/www/html/cacti/plugins/thold/includes/polling.php on line: 275
2022-03-17 12:02:53 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'thold'
2022-03-17 16:15:45 - SYSTEM THOLD DAEMON STATS: TotalTime:0.000 MaxRuntime:0.000 Processed:0 InProcess:0 TotalDevices:70 DownDevices:1 NewDownDevices:0 MaxProcesses:1 Completed:0 Running:0 Broken:0

@bentech4u
Copy link
Author

Still plugins are getting disabled

@TheWitness
Copy link
Member

Okay, I took a closer look at the function and it there was an oversight in it's original construction. I'm fixing it now.

TheWitness added a commit that referenced this issue Mar 21, 2022
The strpos() function will return the position of the first instance of a string which in PHP is 0.  So, you have to check for "false" insted.  Also, switching to non-case sensitive search for good measure.
@bentech4u
Copy link
Author

I have done the changes and will update you the outcome. Thanks for your help

@bentech4u
Copy link
Author

Seems like Thold issue solved and it is active after one day. Thanks for support.

@netniV netniV changed the title Plugins automatically disabled on cacti release when they exceed their maximum allowed runtime When plugin exceed runtimes, they should not be automatic disabled Apr 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

7 participants