kendallgoto / ilo4_unlock

A toolkit for patching HPE's iLO 4 Firmware with access to previously inaccessible utilities
GNU General Public License v3.0
345 stars 46 forks source link

Create kg-silence-dl380pG8-screen-method.sh #3

Closed Aterfax closed 2 years ago

Aterfax commented 2 years ago

This is an alternative script which uses SSH keys and screen to preserve the first TTY for further input and to see further output.

This avoids the bug where only the first SSH session / TTY gets fan info stdout.

kendallgoto commented 2 years ago

LGTM! thanks for this - I had an older script that kept a screen alive to work around the tty bug but it never really worked well so I didn't include it in the repo. SSH keys are way cleaner than the sshpass scripts - I didn't realize the iLO actually supported keys until much later & haven't been bothered to mess with my scripts yet

Aterfax commented 2 years ago

Just as a general info to anyone coming and using it - you'll need to add a loop sending a command on a fixed interval (120 seconds? is probably fine) or the tunnel will time itself out.

I was mainly just using this during upstart when debugging which sensors were needing silencing.

Might need a slight amendment but I am too tired to play about with it atm.

kendallgoto commented 2 years ago

I use two cron jobs w/ my scripts to handle this -- something like:

@restart /home/whatever/my-start-script.sh # trigger script at bootup
*/6 * * * * /usr/bin/screen -S my-screen-name -X stuff 'fan info'`echo -ne '\015'` # send fan info regularly to keep alive

imo easier to maintain than an upstart / systemctl conf, at least in my setup

Aterfax commented 2 years ago

Aye, cron is perfect for this! :laughing: Told you I was tired!