Monday, March 25, 2013

Quick Guide: Installing Ubuntu For X-Plat Demo Purposes

Last week I added an Ubuntu based server in my OM12 test environment. I needed a demo where a Linux server is monitored by OM12. This posting is a high level overview of all the steps involved.

There is much to tell, so let’s start.

Part 1: Obtain, install Ubuntu and configure it
This part costed me a few hours in the evening to get it right. I installed Ubuntu Server about 5 times. The installer is really user friendly, but I wanted to gain some non-Microsoft OS installation experiences. Also I didn’t like the absence of a GUI so I experimented with some of the different flavors available. Finally I opted for the Gnome full desktop environment.

  1. Download the correct version and architecture of Ubuntu Server from here. I downloaded Ubuntu Server 12.04.2 LTS since that version is fully supported with OM12 SP1. For the flavor I opted for 64 bit.
  2. In Hyper-V I created a new VM with 1 CPU and 1024 MB of RAM. Added the default NIC I use for all VMs and connected the dvd-drive to the ISO image I downloaded in Step 1;
  3. After the VM was created successfully I started it and ran the installation. This installation ran within 10 minutes! Important is to have a working internet connection for that VM since some components are downloaded during installation;
  4. During the installation follow the wizard and answer all questions. Also create an account with a password;
  5. When the installation is finished, the server reboots and within a minute the server is up and running. Enter the credentials you created in Step 4 and you’re in!
  6. Since I am a Windows guy I missed the GUI already. After some testing I decided to use the Gnome Full Desktop. This Ubuntu Wiki tells you how to install different GUI’s on Ubuntu server. Of course there are many reasons why NOT to install a GUI but I wanted a GUI none the less. Finally I gave this command: sudo apt-get install ubuntu-desktop. This will take a while since all related components are downloaded from the internet and installed afterwards. When the download and installation is finished, simply reboot the server. When it comes back online the GUI is started automatically and you can log on with the same set of credentials created in Step 4.

So now we have an up and running Ubuntu server. Our final goal is to monitor it with OM12 SP1 UR#1. So now we have to configure OM12 accordingly.

Part 2: Prepping OM12
Even though OM12 is capable of monitoring UNIX/Linux systems, there is some preparation required. Otherwise it simply won’t work.

  1. Bring OM12 to most current level, which is at this moment SP1 and UR#1;
  2. Also download the latest UNIX/Linux MPs available for OM12 SP1 UR#1, to be found here. Run the installer on an OM12 MS server;
  3. Now it’s time to import the required MPs. They reside on several locations:
    1. Installation media OM12 SP1
      Go to the folder ~\ManagementPacks and import these four MPs:
      - Microsoft.Linux.UniversalR.1.mpb (Oracle and CentOS Linux distributions);
      - Microsoft.Linux.UniversalD.1.mpb (Debian and Ubuntu).
    2. Updated Linux MPs as stated in Step 2
      Go to the folder C:\Program Files (x86)\System Center Management Packs\System Center 2012 MPs for UNIX and Linux and select this MP:

      Go to the folder C:\Program Files (x86)\System Center Management Packs\System Center 2012 MPs for UNIX and Linux\Microsoft.Unix.Library\2012 SP1 and select this MP:
  4. The MPs used for monitoring UNIX/Linux systems also contains the Agents which are installed on those UNIX/Linux servers. So when the MPs are imported, the related Agents are ‘extracted’ and published in the folder ~:\Program Files\System Center 2012\Operations Manager\Server\AgentManagement \UnixAgents\DownloadedKits of all your Management Servers.

    In order to work the Agent Action account requires admin permissions on the OM12 Management Servers. So  make sure this account has sufficient permissions. This can also take some time during which the HealthService.exe process might consume more CPU time than usual. So keep this in mind before importing the UNIX/Linux MPs.
  5. Kevin has written an excellent posting all about monitoring UNIX/Linux with OM12. Go here and:
    1. Create a Resource Pool for UNIX/Linux monitoring;
    2. Configure the Xplat certificates for all OM12 MS servers;
    3. Create and configure the Run As accounts for UNIX/Linux;
    4. and don’t go to the step Discover and deploy Agents since the Ubuntu server requires a bit more magic Smile.
  6. Make sure the name of the Ubuntu box is properly resolved to the IP address. Only use DNS for it when the FQDN matches the FQDN of the Ubuntu box. In my case this didn’t work. The host record resolved the FQDN while the the Ubuntu box only has the name ubuntu. This will frustrate the automatic creation of the certificate since the FQDN doesn’t match the name of the UNIX\Linux server. In my case I ended up removing the host record from DNS and adding the entry in the hosts file of both OM12 MS servers. Then I flushed the dns cache on both OM12 MS servers. Afterwards the deployment of the Agent to the Ubuntu box went fine.

So now OM12 is prepped and ready. Now we need to spend a bit more time on the Ubuntu server in order to get it totally right so we know it will be monitored by OM12.

Part 3: Prepping Ubuntu
Ubuntu requires some additional attention. SSH (Secure SHell) must be installed and initialized (happens automatically). I had some issues with installing the SCOM 2012 Agent on the Ubuntu server because superuser privileges were required. Therefor I activated the root account (disabled by default).

I know enabling the root account isn’t best practice but hey, I needed a demo! So this isn’t production at all and I don’t know much about Ubuntu. Also the evenings are short of time already so I took this shortcut. In production environments there are system engineers with deep UNIX/Linux experience available so they know how to go about it. Don’t hesitate to get them involved since their knowledge and experience will be required.

  1. Install SSH
    This blog posting tells it all.
  2. Enabling the root account
    This webpage shows how to do that. Search for ‘Enabling the root account’. In my demo I gave it the same password as I use for my own account on the Ubuntu box.

Part 4: Discovering and deploying the Agent to the Ubuntu box
Now everything is in place for the last phase, deploying the Agent on the Ubuntu box.

The earlier mentioned posting written by Kevin Holman contains good information about it, and follow the steps described in the procedure Discover and deploy the agents.

Within a couple of minutes my Ubuntu box was discovered, the OM12 Agent installed on it and monitored by OM12:



Helpful resources
Back in the days of SCOM R2 there weren’t many resources to be found about deploying Agents to UNIX/Linux servers. Much has changed for the better nowadays. These are the resources I used:

  1. A Wiki, written by Microsoft all about troubleshooting UNIX/Linux Agent Discovery in OM12;
  2. How to Configure sudo Elevation and SSH Keys;
  3. How to Configure Run As Accounts and Profiles for UNIX and Linux Access
  4. The posting written by Kevin Holman
  5. A posting written by Robbie Roberts

Microsoft has done a great job by deciding to monitor non-Microsoft platforms in SCOM R2 and has made it better in OM12 and OM12 SP1 as well.

Also their decision to make the SCOM R2/OM12 Agent on UNIX/Linux servers light weight (the execution of the MPs for UNIX/Linux monitoring happens on the OM12 Management Servers which are part of the Resource Pool used for UNIX/Linux monitoring, compared to the Agents used for Windows Servers) has helped the overall adoption rate of SCOM R2/OM12 for monitoring UNIX/Linux systems in a great way.

IMHO this is a great feature of OM12 and I am happy to see that with every iteration of OM12 this functionality is extended even more. Well done Microsoft!

No comments: