FENCE_AGENT(8)

πŸ“¦ version 4.17.0, in fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– FENCE_AGENT(8) πŸ’– β€” the System Manager's Manual, but make it make sense

okay bestie, so this is a page from section 8 of the manual (that's the system manager's manual, the admin-y one), and it's all about fence_shelly_gen2. sit down, grab a strawberry drink, we're doing fencing πŸ“


✨ NAME ✨

fence_shelly_gen2 β€” the fence agent for Shelly Gen 2+ Switches. that's it, that's the name, no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

so fence_shelly_gen2 is a Power Fencing agent you use with Shelly Switches that speak the gen 2+ API, and its whole job is fencing the hardware that's attached to them. slay.

and here's the thing about how it takes input β€” the fence agent accepts options on the command line and from stdin. when fenced execs the agent, it sends parameters through stdin. but you can also just run the agent by itself with command line options, which is genuinely so useful for testing and for flipping outlets on or off from scripts. main character behavior honestly.

Vendor URL: https://shelly-api-docs.shelly.cloud/gen2/ β€” go look, iykyk πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • -o, --action=[action] β€” the fencing action. (Default Value: reboot) πŸ’«
  • -a, --ip=[ip] β€” IP address or hostname of the fencing device. This parameter is always required. like, always always.
  • -u, --ipport=[port] β€” TCP/UDP port to use for the connection with the device. (Default Value: 80)
  • -t, --notls β€” Disable TLS negotiation and force SSL3.0. ⚠️ lowkey scary: this should only be used for devices that do not support TLS1.0 and up.
  • -p, --password=[password] β€” Login password or passphrase πŸ”
  • -S, --password-script=[script] β€” Script to run to retrieve the password.
  • -n, --plug=[id] β€” Physical plug number on the device, UUID, or identification of the machine. This parameter is always required. no skipping bestie.
  • -z, --ssl β€” Use SSL connection with verifying certificate. πŸ”’
  • --ssl-insecure β€” Use SSL connection without verifying certificate. πŸ™ˆ
  • --ssl-secure β€” Use SSL connection with verifying certificate. πŸ”’
  • -q, --quiet β€” Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
  • -v, --verbose β€” Verbose mode. Multiple -v flags can be stacked on the command line (e.g., -vvv) to increase verbosity. stacking buffs, literally.
  • --verbose-level β€” Level of debugging detail in output. Defaults to the number of --verbose flags specified on the command line, or to 1 if verbose=1 in a stonith device configuration (i.e., on stdin).
  • -D, --debug-file=[debugfile] β€” Write debug information to the given file.
  • -V, --version β€” Display version information and exit.
  • -h, --help β€” Display help and exit.
  • --plug-separator=[char] β€” Separator for the plug parameter when you're specifying more than 1 plug. (Default Value: ,)
  • -C, --separator=[char] β€” Separator for the CSV created by the list operation. (Default Value: ,)
  • --delay=[seconds] β€” Wait X seconds before fencing is started. (Default Value: 0)
  • --disable-timeout=[true/false] β€” Disable timeout (true/false) (default: true when run from Pacemaker 2.0+)
  • --login-timeout=[seconds] β€” Wait X seconds for the cmd prompt after login. (Default Value: 5)
  • --power-timeout=[seconds] β€” Test X seconds for status change after ON/OFF. (Default Value: 20)
  • --power-wait=[seconds] β€” Wait X seconds after issuing ON/OFF. (Default Value: 1)
  • --shell-timeout=[seconds] β€” Wait X seconds for the cmd prompt after issuing a command. (Default Value: 5)
  • --stonith-status-sleep=[seconds] β€” Sleep X seconds between status calls during a STONITH action. (Default Value: 1)
  • --retry-on=[attempts] β€” Count of attempts to retry power on. (Default Value: 1)
  • --gnutlscli-path=[path] β€” Path to the gnutls-cli binary. (Default Value: /usr/bin/gnutls-cli)

πŸ‘‘ ACTIONS πŸ‘‘

  • on β€” Power on machine. ⚑
  • off β€” Power off machine. πŸ’€
  • reboot β€” Reboot machine. πŸ”„
  • status β€” This returns the status of the plug/virtual machine.
  • list β€” List available plugs with aliases/virtual machines if there is support for more than one device. Returns N/A otherwise.
  • list-status β€” List available plugs with aliases/virtual machines and their power state, if it can be obtained without additional commands.
  • monitor β€” Check the health of the fence device. 🩺
  • metadata β€” Display the XML metadata describing this resource.
  • manpage β€” The operational behavior of this is not known. 😭 (yes, that's what it says. we don't know. iconic honestly.)
  • validate-all β€” Validate if all required parameters are entered. βœ…

🌸 STDIN PARAMETERS 🌸

same energy, different door β€” these are the ones that come in over stdin:

  • action β€” Fencing action (Default Value: reboot)
  • ip β€” IP address or hostname of fencing device. This parameter is always required. Obsoletes: ipaddr
  • ipport β€” TCP/UDP port to use for connection with device (Default Value: 80)
  • notls β€” Disable TLS negotiation and force SSL3.0. This should only be used for devices that do not support TLS1.0 and up.
  • password β€” Login password or passphrase. Obsoletes: passwd
  • password_script β€” Script to run to retrieve password. Obsoletes: passwd_script
  • plug β€” Physical plug number on device, UUID or identification of machine. This parameter is always required. Obsoletes: port
  • ssl β€” Use SSL connection with verifying certificate
  • ssl_insecure β€” Use SSL connection without verifying certificate
  • ssl_secure β€” Use SSL connection with verifying certificate
  • quiet β€” Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
  • verbose β€” Verbose mode. Multiple -v flags can be stacked on the command line (e.g., -vvv) to increase verbosity.
  • verbose_level β€” Level of debugging detail in output. Defaults to the number of --verbose flags specified on the command line, or to 1 if verbose=1 in a stonith device configuration (i.e., on stdin).
  • debug_file β€” Write debug information to given file. Obsoletes: debug
  • version β€” Display version information and exit
  • help β€” Display help and exit
  • plug_separator β€” Separator for plug parameter when specifying more than 1 plug (Default Value: ,)
  • separator β€” Separator for CSV created by list operation (Default Value: ,)
  • delay β€” Wait X seconds before fencing is started (Default Value: 0)
  • disable_timeout β€” Disable timeout (true/false) (default: true when run from Pacemaker 2.0+)
  • login_timeout β€” Wait X seconds for cmd prompt after login (Default Value: 5)
  • power_timeout β€” Test X seconds for status change after ON/OFF (Default Value: 20)
  • power_wait β€” Wait X seconds after issuing ON/OFF (Default Value: 1)
  • shell_timeout β€” Wait X seconds for cmd prompt after issuing command (Default Value: 5)
  • stonith_status_sleep β€” Sleep X seconds between status calls during a STONITH action (Default Value: 1)
  • retry_on β€” Count of attempts to retry power on (Default Value: 1)
  • gnutlscli_path β€” Path to gnutls-cli binary (Default Value: /usr/bin/gnutls-cli)

quick vibe check: -t/--notls forcing SSL3.0 is not a casual choice. only for devices that don't do TLS1.0 and up. don't be reckless with your security bestie 🫢

and that's the whole page!! this one's fence_shelly_gen2 (Fence Agent), dated 2009-10-20, and it lives in section FENCE_AGENT(8). thanks for reading my little manual rant, you ate πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from