Printable version |
|
|
In order for it to be automated, it must be possible to log in to the iLO using SSH keys. This is key-based authentication instead of password based, so it retains security but allows non-interactive logins based on trust.
To set up key based authentication, it is wise to set up a user with only the functions you require enabled. In this case, create a user called ilouser that only has privileges against the ‘Virtual Power and Reset’ option. Note down the password, but be aware that it is not required after this stage.
Once the user has been set up on the iLO, a key-pair with the same username has to be generated. At the command line on a Linux machine, generate the keypair with…
ssh-keygen -b 1024 -f ilouser -C ilouser
This creates two files.
KyleG@WMWS0001:/tmp> ls -l ilouser*
-rw——- 1 KyleG users 887 2008-12-09 11:21 ilouser
-rw-r–r– 1 KyleG users 217 2008-12-09 11:21 ilouser.pub
KyleG@WMWS0001:/tmp>
ilouser.pub – this is the public part that will get uploaded to the iLO
Log in to the iLO again, and select the SSH Key Authorization menu. Browse to your ilouser.pub and upload it to the iLO. All being well, the iLO will accept it against the ilouser account (or an account with the same details as the comment field in the public key – ilouser.pub)
Test that the system can log in by specifying the location of the private key (the file without the .pub), the username to login with, and the hostname.
ssh -i /home/KyleG/ilouser/ilo-user [email protected]
It sounds complex, but in reality use the above command and append the command you want to execute onto the end, enclosed in single quotes.
KyleG@WMWS0001:/tmp> ssh -i /tmp/ilouser [email protected] ‘power on’
dispatch_protocol_error: type 100 seq 8
power on
To automate it, use crontab on a different machine and use the above command. An example crontab line would be
30 2 * * * /usr/bin/ssh -i /home/KyleG/ilouser/ilouser [email protected] ‘power on’