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

Poller is including plugins that are not installed #1389

Closed
netniV opened this issue Feb 22, 2018 · 4 comments
Closed

Poller is including plugins that are not installed #1389

netniV opened this issue Feb 22, 2018 · 4 comments

Comments

@netniV
Copy link
Member

netniV commented Feb 22, 2018

So I did a bad thing.... I wrote a 'BADPLUGIN' plugin... And within even installing the plugin, it breaks poller!!

This plugin has the following three files

Info File

[info]
name = badplugin
version = 1.0
longname = A BAD PLUGIN
author = The Devil
email =
homepage = http://goto.hell
compat = 1.1.10
capabilities = online_view:1, online_mgmt:1, offline_view:0, offline_mgmt:0, remote_collect:0

File: setup.php

<?php
        throw new exception();

File: functions.php

<?php
        throw new exception();

Error Log

It results in this error log even though I never actually installed it:


2018/02/22 11:10:03 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'badplugin'
--
2018/02/22 11:10:03 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4625 cacti_debug_backtrace)
thrown in file: /usr/share/cacti/develop/plugins/badplugin/setup.php on line: 2
#3 {main}
#2 /usr/share/cacti/develop/poller.php(716): snmpagent_poller_bottom()
#1 /usr/share/cacti/develop/lib/snmpagent.php(457): snmpagent_get_pluginslist()
#0 /usr/share/cacti/develop/lib/snmpagent.php(542): include_once()
Stack trace:
2018/02/22 11:10:03 - ERROR PHP ERROR in Plugin 'badplugin': Uncaught Exception in /usr/share/cacti/develop/plugins/badplugin/setup.php:2
2018/02/22 11:10:03 - SYSTEM STATS: Time:1.3055 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:65 RRDsProcessed:36
2018/02/22 11:05:03 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'badplugin'
2018/02/22 11:05:03 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4625 cacti_debug_backtrace)
thrown in file: /usr/share/cacti/develop/plugins/badplugin/setup.php on line: 2
#3 {main}
#2 /usr/share/cacti/develop/poller.php(716): snmpagent_poller_bottom()
#1 /usr/share/cacti/develop/lib/snmpagent.php(457): snmpagent_get_pluginslist()
#0 /usr/share/cacti/develop/lib/snmpagent.php(542): include_once()
Stack trace:
2018/02/22 11:05:03 - ERROR PHP ERROR in Plugin 'badplugin': Uncaught Exception in /usr/share/cacti/develop/plugins/badplugin/setup.php:2
@cigamit
Copy link
Member

cigamit commented Feb 22, 2018

Yea, that's bad. Seems I only fixed that bugger only half way.

cigamit added a commit that referenced this issue Feb 22, 2018
Poller is including plugins that are not installed
@cigamit
Copy link
Member

cigamit commented Feb 22, 2018

Well, on the face of it, that function was doing way too much. Going to make one more change...

cigamit added a commit that referenced this issue Feb 22, 2018
Make sure the status is 0 for not installed plugins.
@cigamit
Copy link
Member

cigamit commented Feb 22, 2018

Should be resolved now. This was made simpler by the fact that we do not support pre 1.x plugins.

@cigamit cigamit closed this as completed Feb 22, 2018
@netniV
Copy link
Member Author

netniV commented Feb 22, 2018

That works for me lol. I'll give it another stomach ache and see if your relief works ;-)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants