Add user-customizable buttons to execute commands
Issue #762
new
As far as I'm concerned, it could be so exciting if monit supports user-customizable buttons like this:
IN TASK FOCUSED CONFIG FILE
check program test path "/opt/etc/monit.d/test/test_start" every 2 cycles
start program = "/opt/etc/monit.d/test/test_start"
stop program = "/opt/etc/monit.d/test/test_stop"
*---------- add statements as below ----------*
add button 'CUSTIMIZED BUTTON NAME 1' = 'PATH/COMMAND1'
add button 'CUSTIMIZED BUTTON NAME 2' = 'PATH/COMMAND2'
*---------- end ----------*
if status != 0 then stop
IN WEB PAGE
Buttons defined in the config file above and named 'CUSTIMIZED BUTTON NAME 1' and 'CUSTIMIZED BUTTON NAME 2' appear below the line which the button "start" lies in.
It might be easier to parse, if it follows the current config. Like
So even the command line can use it as
monit custom0 test
. On the web, If the "as" is omitted, it might output "Custom Command (/path3)". This might even not limit the available slots if you search for/custom\d+ program/
.It's also a great idea if you want to group those. You might have a program that reloads the configs (like @LutzMad mentioned in #753) and place it at
custom1337
every time, you can end up doingmonit custom1337 all
the reread all configs where possible...