Cacti / plugin_mikrotik

Mikrotik Plugin for Cacti
GNU General Public License v2.0
60 stars 24 forks source link

undefined index, error for cacti 1.2.10 #41

Closed vegnuli closed 4 years ago

vegnuli commented 4 years ago

Describe the bug got http 500 error due undefined index in plugin, see log:

2020-03-19 12:06:29: (mod_fastcgi.c.421) FastCGI-stderr: PHP message: PHP Warning:  include(./include/auth.php): failed to open stream: No such file or directory in /var/lib/cacti/plugins/mikrotik/mikrotik.php on line 26PHP message: PHP Warning:  include(): Failed opening './include/auth.php' for inclusion (include_path='.:/usr/share/php7') in /var/lib/cacti/plugins/mikrotik/mikrotik.php on line 26PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function set_default_action() in /var/lib/cacti/plugins/mikrotik/mikrotik.php:28
2020-03-19 12:06:29: (mod_fastcgi.c.421) FastCGI-stderr: Stack trace:
2020-03-19 12:06:29: (mod_fastcgi.c.421) FastCGI-stderr: #0 {main}
2020-03-19 12:06:29: (mod_fastcgi.c.421) FastCGI-stderr:   thrown in /var/lib/cacti/plugins/mikrotik/mikrotik.php on line 28

To Reproduce Steps to reproduce the behavior:

  1. install plugins.. no errors (got to plugins settings, install and enable)
  2. install template.. no errors php /usr/share/webapps/cacti/cli/import_package.php --filename=MikroTik_Device.xml.gz
  3. go to settings and enable plugin microtik tab
  4. go to main and then click on mikrotik tab.. got error 500 see screenshots

Expected behavior to work

Screenshots

Sorry, we could not process your last action.

Error:  500 Internal Server Error
Reason: The response to the last action was unexpected.

Plugin (please complete the following information):

Desktop (please complete the following information):

vegnuli commented 4 years ago

hi.. cited @TheWitness in cacti main repo it sais:

The MikroTik problem is a web server configuration issue, but we'll fix it to work around that configuration issue.

that means, without network connection will not install? there's a way to fix manually that? please?

TheWitness commented 4 years ago

@vegnuli, you likely don't have 'read' access to include/auth.php, and that error would not prevent the install. I've reviewed the code and it's correct. So, there is some other issue you are having. This is a red herring. Plus, that error would not take place unless you navigated to the mikrotik plugin, which does not happen during the install.

TheWitness commented 4 years ago

Additionally, the 500 error indicates that there is some problem on the backend. You should be able to setup php's error_log and direct it to a file. From there, you will be able to see the errors. If you set that path to something like /tmp/php_errors.log, then due to the way systemd works, you will find a /tmp directory under something like /tmp/systemd*http/tmp. I have not used nginx, so I'm not certain the service name. If it's httpd, then the above example would be correct.

TheWitness commented 4 years ago

No feedback.

mckaygerhard commented 4 years ago

all of hat thing sound like chinesse for that guy! puff.. what kind of help!

TheWitness commented 4 years ago

Some things people have to find out for themselves. Sometimes dev's don't listen cause it's a hobby and not their problem. Either way, time keeps ticking by.