Skip to content

Custom Commands

Custom commands let you add server-specific checks to the server detail page. Their output is collected whenever the App refreshes that server’s status.

The commands live on each server, in ~/.config/server_box/custom_cmds. The App does not keep a local copy: the editor loads the files from the server and writes changes back when you save.

You must be connected to the server to save edits. If it is unreachable, you can open the editor but not save. The App and Monitor use the same files, so edits in either one are immediately visible in the other.

  1. Open the server’s edit page and select Custom commands → Edit.
  2. Add a command, change its name or shell text, or drag it to a new position.
  3. Save the changes to the server.

Each entry contains a display name and a shell command. The App uses the name as the output label on the server detail page.

The saved order is also the order used on the server detail page. Reorder commands in the editor to change how they appear.

The command named server_card_top_right is a special case. Its output is shown in the top-right corner of the server card on the home page rather than in the regular custom-command list.

Use absolute paths:

Terminal window
/usr/local/bin/my-script.sh

Pipes are supported:

Terminal window
ps aux | sort -rk 3 | head -5

Format output:

Terminal window
uptime | awk -F'load average:' '{print $2}'

Keep execution time short. Aim for less than one second because the command runs on every status refresh.

Limit output:

Terminal window
tail -20 /var/log/syslog

Commands run with the account used for the connection: the SSH user for SSH connections, or the Monitor process user for Monitor connections.

For Monitor connections, the request must use secure transport or explicitly permit allow_insecure. Each file in this directory is executable code: it runs as the Monitor user on every status refresh.

Use read-only commands where possible. A command can affect the server with the permissions of its execution account. Never include passwords, tokens, or other credentials in a command.

Older releases stored commands in server settings; the App preserves those entries until the first connection, then moves them to ~/.config/server_box/custom_cmds. Current releases read and write commands only in that directory.