Friday, February 7, 2014

Updating OCDoctor on Guest Domains Lacking Internet Connectivity

I've recently been upgrading Oracle Enterprise Manager Ops Center from Update 2, to Update 4. One of my many post-checks was to run an OCDoctor on every system, be it LDom, CDom, EC or Proxy Controller. Our guest domains can't reach the internet, and so I needed a quick way to push out and install the latest OCDoctor. The following line of code enumerates the list of LDoms (dropping the last character to match the hostname), copy over the bundle, and install.

# for x in $(ldm list | egrep -v NAME\|primary | awk '{print $1}' | sed 's/.$//'); do echo ${x}:; scp /var/tmp/ root@${x}:/var/opt/sun/xvm/; ssh root@${x} "cd /var/opt/sun/xvm; mv OCDoctor OCDoctor-20140207; unzip"; done