Add user-customizable buttons to execute commands

Issue #762 new
Jack Think created an issue

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.

Comments (1)

  1. Henning Bopp

    It might be easier to parse, if it follows the current config. Like

    check program test path "test"
      start program = "/path1"
      custom0 program = "/path2" as "My Button Text"
      custom1 program = "/path3"
    

    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 doing monit custom1337 all the reread all configs where possible...

  2. Log in to comment