Closed sivakumarv47 closed 1 year ago
Hi @sivakumarv47
Can i get more details about your ask? What do you mean by iDRAC console? Are you asking if you can make a Redfish GET request from a client system to the iDRAC?
Thanks Tex
Hi Tex, I am asking can we use redfish api to execute a command or get output on the virtual console of the server.
Thanks Siva
Ok, so from the virtual console or local operating system, this is no local Redfish support like local RACADM where with local RACADM you don't need to pass in iDRAC IP and creds to run local RACADM commands. If running Redfish commands from within the OS, you can leverage either iDRAC IP or iDRAC USB-NIC IP.
See example below where i use iDRAC USB-NIC IP to run Redfish GET request from the OS.
Thanks Tex
Thanks Tex for the answer. But i think there is a confusion in my question
I am asking is there any way from redfish api or any other automated way to execute command on the virtual console.
For E.g. ls -ltr command on virtual console and get the output Attaching the screenshot.
Thanks Siva
Thanks for the example, this clears up the ask. So this is not supported by iDRAC and Redfish. For automating you could SSH to linux OS IP and then run any command, capture the output to a variable or a file.
Examples:
Python code:
import subprocess
command_output = subprocess.run("ssh root@192.168.0.120 ls -la /nfs", shell=True) print(command_output)
Capture output to a file:
C:\Python310>ssh root@192.168.0.130 "ls -la /nfs" > output.txt root@192.168.0.130's password:
C:\Python310>type output.txt total 8388620 drwxrwxrwx 2 root root 4096 Jan 30 20:29 . drwxr-xr-x 20 root root 4096 Jan 30 14:27 .. -rw-r--r-- 1 root root 8589934592 Jan 30 20:29 data.img
@texroemer wouldn't be SOL (serial-over-lan) useful here? Or it's only for output?
Yes you can use SOL to run OS linux commands but you must first configure grub in the OS, configure iDRAC and BIOS settings.
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Then run "grub2-mkconfig -o /etc/grub2-efi.cfg" to compile the changes.
Make iDRAC changes for IPMI and SOL:
From your client system, you can use the following two methods to start the SOL session to the OS:
I did not find any api call in the documentation https://developer.dell.com/apis/2978/versions/5.xx/docs/0WhatsNew.md