librenms-plugins / Weathermap

MIT License
64 stars 51 forks source link

executing map-poller.php from UI #58

Closed krakazyabra closed 5 years ago

krakazyabra commented 5 years ago

Hi!
I want to make custom link to file map-poller.php (to refresh map every time I want, not even from cron).
So, i added this link, but during execution, I get error

#!/usr/bin/env php ERROR: map-poller.php should ONLY be run as a CGI script!

I'm using nginx with php-fpm. How can i execute this file from interface?

sk4mi commented 5 years ago

As the error says: you can’t execute it outside cli. If you really want, you can modify the script and remove if statement. But it’s not recommended.

Sent with GitHawk

krakazyabra commented 5 years ago

I walkedthroug this error:
NGINX+FastCGI+perl script

print "Content-type: text/html\n\n";
system("sudo -u librenms /opt/librenms/html/plugins/Weathermap/map-poller.php");

And everything is working fine.

This way i could add new tab to refresh maps in LibreNMS menu.

laf commented 5 years ago

This isn't a plugin issue but is from the network weathermap software so closing this down.