Create button to execute a batch or command file

Hi everybody,
In Grafana 8, installed in Windows 10, I would like to have the fonctionnality to stop or restart program or service.
Is it possible to create a “Button” to execute a batch file ?

@richardgaudin that’s not really possible directly as described. Check out these two threads for related discussions/ways to do it:

I guess what you could do is creating a plugin calling an API that will run the scripts you want

Indeed, a backend plugin would let you execute commands on the server. You could then control it from an app plugin or a panel plugin. It would require a fair amount of development work, but it’s definitely possible.

thanks for these answers but i don’t understood how i can do it…
Could you please provide more explanantion, example ?

The short explanation is that unless you feel comfortable writing Typescript or Go code, it’s not supported. If you’d like to try, you can start with the tutorial on how to Build a backend plugin.

The main issue is that for security reasons Grafana won’t let you execute custom scripts and processes on the server. If you can somehow set up a web service on the machine that lets you control your program using a REST API, you could use something like the Button panel.

1 Like