OME 3.1 running multiple racadm commands in one job?
Hi,
Just wondering if anyone knows whether the above is possible. Running 1 command per job works perfectly, but say I want to edit all of the event filters, do I have to run a job per change when using RACADM? For example is there a way to run the following:
eventfilters set -c idrac.alert.config.swc.warning -a none -n snmp eventfilters set -c idrac.alert.config.swc.critical -a none -n snmp
As one job? Or do I have to run two separate jobs?
I don't think it will work that way. There is a note on the help page that only one executable or script is allowed at a time. If you click the question mark in the top right and search script you should pull up the information. The reason it will likely fail is because of the way the remote command works. It is going to perform a racadm remote command with the authentication method provided, after that it will input the command. If you are entering multiple commands it will run them back to back. There is an expectation that each line will contain the racadm remote authentication information since the commands are not session based. Authentication should occur with each command.
If you are wanting to send multiple commands then I suggest sending them in a script. You can find information in the OMEnt manual and iDRAC CLI guide.
Thanks for the response. Its a shame that this is the way the OME Racadm 'job' works, as it would be great to create a batch job to run a load of racadm commands.
Also I noticed a bug in that the only way to run racadm commands against an entire custom group is to select one device, and then under target change it to groups and select the required groups. it seems a hacky way for it to work and some people may not even know that functionality is there.
There probably is a way to do a batch job. I would think that there are two ways it could be done in a batch.
The first method would be to start a session and then run all of the racadm commands with the appropriate line breaks. At the end perform a log out, so it would be login, commands, and then logout in the batch file. The second method would be to enter multiple commands using remote racadm in each command. You will likely need to insert pauses if you have a long list of remote racadm commands.
I've written a couple of bash scripts to just loop through a list of hosts and use a heredoc for passing in commands.
Eg for setting up a monitoring user and enabling SNMPv3
read -e -p "Enter server names separated by space: " servers
if $(command -v sshpass > /dev/null); then
read -p "Enter drac root user password: " password
connect="sshpass -p $password ssh"
else
echo "You will have to manually enter passwords without sshpass"
connect='ssh'
fi
read -e -p "Enter monitoring user password: " monPassword
for host in ${servers[@]}; do
echo 'connecting to' $host
$connect root@$host << EOF
racadm set iDRAC.Users.3.Username monitoring
racadm set iDRAC.Users.3.Password $monPassword
racadm set iDRAC.Users.3.Enable 1
racadm set idrac.users.3.ProtocolEnable
EOF
This is kinda slow and doesn't always work very well, and if you're working on 100's of servers then simply iterating isn't enough, you need some way to fork your processes.
So now I'm looking at moving the scripts to Ansible, for example a very simple playbook demonstrating multiple racadm commands
---
- hosts: exampleserver
gather_facts: no
tasks:
- name: Get Server OS name
raw: racadm get System.ServerOS.HostName
- name: Get power redundancy
raw: racadm get System.Power.RedundancyPolicy
Really appreciating your update on this one.. Yeah I have more than 200+ hosts and batch job is not quite working well.. I made an entry of each of racadm commands and put that in powershell and running it and seems running one by one.. some kind it's working..
Daniel My
12 Elder
•
6205 Posts
6092
0
Posted April 8th, 2019 10:00
Hello
I don't think it will work that way. There is a note on the help page that only one executable or script is allowed at a time. If you click the question mark in the top right and search script you should pull up the information. The reason it will likely fail is because of the way the remote command works. It is going to perform a racadm remote command with the authentication method provided, after that it will input the command. If you are entering multiple commands it will run them back to back. There is an expectation that each line will contain the racadm remote authentication information since the commands are not session based. Authentication should occur with each command.
If you are wanting to send multiple commands then I suggest sending them in a script. You can find information in the OMEnt manual and iDRAC CLI guide.
http://www.dell.com/openmanagemanuals/
http://www.dell.com/idracmanuals/
Thanks