UNSOLVED

cameronredux

updated

13 years ago

C

cameronredux

2 Intern

•

615 Posts

0

57087

October 9th, 2013 16:00

Complex remote command line tasks

I run single line racadm commands on a regular basis against multiple devices at once using the remote task functionality in OME and it's very helpful.

And example would be:

getconfig -g cfgIpmiPet -i 1

but now I have a more complex command and am not sure of the process in OME.

For example I want to enable 1-3, disable 4, change all four IPv4 SNMP trap destination IPs, change the trap community and send test traps for all four.

When logged into the DRAC over ssh I would just cut and paste all the commands at once with returns at the end of each line and it would all run and make the changes and show me the change for confirmation:

racadm config -g cfgIpmiPet -i 1 -o cfgIpmiPetAlertEnable 1
racadm config -g cfgIpmiPet -i 2 -o cfgIpmiPetAlertEnable 1
racadm config -g cfgIpmiPet -i 3 -o cfgIpmiPetAlertEnable 1
racadm config -g cfgIpmiPet -i 4 -o cfgIpmiPetAlertEnable 0
racadm config -g cfgIpmiPet -i 1 -o cfgIpmiPetAlertDestIpAddr 10.2.2.2
racadm getconfig -g cfgIpmiPet -i 1
racadm testtrap -i 1
racadm config -g cfgIpmiPet -i 2 -o cfgIpmiPetAlertDestIpAddr 10.3.3.3
racadm getconfig -g cfgIpmiPet -i 2
racadm testtrap -i 2
racadm config -g cfgIpmiPet -i 3 -o cfgIpmiPetAlertDestIpAddr 10.4.4.4
racadm getconfig -g cfgIpmiPet -i 3
racadm testtrap -i 3
racadm config -g cfgIpmiPet -i 4 -o cfgIpmiPetAlertDestIpAddr 0.0.0.0
racadm getconfig -g cfgIpmiPet -i 4
racadm testtrap -i 4
racadm config -g cfgIpmiLan -o cfgIpmiPetCommunityName trapome
racadm getconfig -g cfgIpmiLan -o cfgIpmiPetCommunityName

So how do I do all that from OME?

Will the remote task functionality let me run multiple line commands?

  • DELL-Pupul M

    2 Intern

    •

    1004 Posts

    3280

    0

    Posted October 10th, 2013 01:00

    Hi Cameron,

    Thanks for the post.

    Right now to use the remote task feature of OME to run a script or multiple commands at once, you can use the generic command line feature. The white paper here should be able to help you in doing that: 

    http://en.community.dell.com/techcenter/extras/m/white_papers/20024495.aspx

    Let us know if this helps.

  • cameronredux

    2 Intern

    •

    615 Posts

    3280

    0

    Posted October 10th, 2013 11:00

    That white paper seems to only cover using powershell.

    I am not interested in learning the convoluted usage and security requirements of powershell. We are not a windows shop. If that is what is required to run a multi line command from OME I will probably bypass OME completely for this type of work and just try to use a for loop in bash accessing racadm on the dracs over ssh :(

  • DELL-Rob C

    4 Apprentice

    •

    2843 Posts

    3280

    0

    Posted October 10th, 2013 14:00

    Hey cameron...

    (skipping past your comments on convolution, etc.)

    You would have to use Windows/Command line to accomplish this task with OME, but it is possible.

     Place all the commands you wish to run in a batch file (a notepad file with .bat extension instead of .txt) like configure_racs.bat

    Place the file in a location like C:\temp\config_racs.bat

    The commands would need to be formatted to run remotely using the –r switch:

     

    racadm -r %1 -u %2 -p%3 getsysinfo

     

    The %1, %2, and %3 would correspond to $IP, $USERNAME, and $PASSWORD in the OME task wizard.

    All these values can be passed from OME to the batch file (see screenshot below)

     

    You can select the targets you want to run against the same was as when you have run single command line tasks versus a target in the past.

    Disclaimer is that I didn't try the large set of commands you have, but let me know how it goes.

    Hope this helps,

    Rob

  • DELL-Rob C

    4 Apprentice

    •

    2843 Posts

    3280

    0

    Posted October 10th, 2013 14:00

    Cool, thanks cameron.

    Yeah, it's interesting to see how folks handle some of these repetitive tasks required when you have to manage multiple boxes.  We'd like to try and push OME to enable you to do some of this 'generic' stuff easily.  Keep the questions coming.

    Regards,

    Rob

  • cameronredux

    2 Intern

    •

    615 Posts

    3280

    0

    Posted October 10th, 2013 14:00

    Hi Rob,

    Thanks for your detailed walkthough!!

    It's good to know I can do that if I need to and your directions I like much better than what I saw in the PDF :)

    I had already ended up just doing essentially that but in a bash script with a for loop for all the server IPs. I ran that from another linux based R410 in the same private network as the DRACs using the remote rac command based on DRAC version (idracadm7 or idracadm) and updated all four dtrap destination IPs , enabled status and trap community on 160 servers  no windows needed :P

    I do ave an additional question about multi lined commands and network setting changes but will do that in a different thread and probably on the main sys mngmnt forum.