Managing Linux Servers with System Center 2012 R2 System Center 2012 R2 Hands-on lab In this lab, you will use System Center 2012 R2 Operations Manager and System Center 2012 R2 Configuration Manager to manage a SUSE Linux Enterprise Server 11 server. You will begin by using Operations Manager to review the overall health of the server, and then use Configuration Manager to deploy a new software package to the SLES server. Produced by HynesITe, Inc Version 1.1 11/12/2013
This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet Web site references, is subject to change without notice. The entire risk of the use or the results from the use of this document remains with the user. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Copyright 2013 Microsoft Corporation. All rights reserved. Microsoft, Hyper-V, Internet Explorer, System Center, Windows, Windows PowerShell, and Windows Server 2012 are trademarks of the Microsoft group of companies. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. All other trademarks are property of their respective owners.
Introduction Estimated time to complete this lab 60 minutes Objectives After completing this lab, you will be able to: Manage a Linux server with System Center 2012 R2 Operations Manager. Deploy software to a Linux server with System Center 2012 R2 Configuration Manager. Prerequisites Before working on this lab, you must have: A basic understanding of Operations Manager. A basic understanding of Configuration Manager. The ability to work in a command line environment. Overview of the lab In this lab, you will use System Center 2012 R2 Operations Manager and System Center 2012 R2 Configuration Manager to manage a SUSE Linux Enterprise Server 11 server. You will begin by using Operations Manager to review the overall health of the server, and then use Configuration Manager to deploy a new software package to the SLES server. Virtual machine technology This lab is completed using virtual machines that run on Windows Server 2012 Hyper-V technology. To log on to the virtual machines, press CTRL+ALT+END and enter your logon credentials. Computers in this lab This lab uses computers as described in the following table. Before you begin the lab, you must ensure that the virtual machines are started and then log on to the computers. Computer Role Configuration DC Domain controller, iscsi SAN Contains a virtual iscsi SAN to provide storage for cluster nodes on a STORAGE network OM CM Server with System Center 2012 R2 Operations Manager installed Server with System Center 2012 R2 Configuration Manager installed SLESNew Unconfigured Linux server None Server used to manage Linux server using System Center 2012 R2 Operations Manager Server used to configure Linux server using System Center 2012 R2 Configuration Manager SLES Configured Linux server System Center 2012 R2 Operations Manager and System Center 2012 R2 Configuration Manager agents installed Admin Client workstation with RSAT Windows 8.1 with RSAT All user accounts in this lab use the password Passw0rd! Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 3
Note regarding pre-release software Portions of this lab may include software that is not yet released, and as such may still contain active or known issues. While every effort has been made to ensure this lab functions as written, unknown or unanticipated results may be encountered as a result of using pre-release software. Note regarding user account control Some steps in this lab may be subject to user account control. User account control is a technology which provides additional security to computers by requesting that users confirm actions that require administrative rights. Tasks that generate a user account control confirmation are denoted using a shield icon. If you encounter a shield icon, confirm your action by selecting the appropriate button in the dialog box that is presented. Note on activation The virtual machines for these labs may have been built by using software that has not been activated. This is by design in the lab to prevent the redistribution of activated software. The unactivated state of software has been taken into account in the design of the lab. Consequently, the lab is in no way affected by this state. For operating systems other than Windows 8.1, please click Cancel or Close if prompted by an activation dialog box. If you are prompted by an Activate screen for Windows 8.1, press the Windows key to display the Start screen. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 4
Exercise 1: Monitoring Linux using System Center 2012 R2Operations Manager In this exercise, you will monitor a Linux server using System Center 2012 R2 Operations Manager. There are two Linux servers in this exercise. SLESNew has just been deployed and is not configured. SLES has already been configured for monitoring. You will first review the configuration required to monitor Linux, and review data capture previously on SLES. You will then use the discover wizard to add SLESNew to the Operations Manager console. Review management packs In this task, you will review the Linux management packs. These management packs are included in the Operations Manager installation media. 1. On the taskbar, click Operations Manager. 2. In Operations Manager, click Administration. 3. Navigate to Administration/Management Packs. 4. In Management Packs, scroll down and find SUSE Linux Enterprise Operating System Library and SUSE Linux Enterprise Server 11 Operating System. These two management packs are used for monitoring SUSE Linux 11. 5. Scroll up and find Linux Operating System Library. This management pack is part of the base requirements for monitoring Linux. Review Accounts In this task, you will review pre-created Unix/Linux Run As accounts. These accounts are used to establish connections to Linux for monitoring and management activities. 1. In Administration, navigate to Run As Configuration/UNIX/Linux Accounts. 2. Double-click Root Account for Maintenance. 3. Click Account Credentials. This account uses a username and password combination, instead of an SSH key, and is a privileged account (super user). 4. Close the UNIX/Linux Run As Account Properties Wizard dialog box. 5. Click Yes. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 5
Review Profiles In this task, you will review the profiles used to monitor Linux. 1. In Administration, navigate to Run As Configuration/Profiles. 2. Scroll down, and then double-click UNIX/Linux Privileged Account. There are three Profiles that must be configured. 3. In Run As Profile Wizard, click Run As Accounts. The profile is configured to use the Root Account for Management account. 4. Click Cancel, and then click Yes. Explore Monitoring Data for Linux In this task, you will explore information that Operations Manager has collected on the SLES server in this environment. 1. In Operations Manager, click Monitoring. 2. Click UNIX/Linux Computers (the object, not the folder). 3. Review the information presented in the details pane. 4. In the Action pane, under UNIX/Linux Computer Tasks, click Top 10 CPU Processes. 5. Click Run. 6. In the Task Status dialog box, review the output of the command, and then click Close. 7. In Navigation, click Diagram View. The diagram shows a logical view of all the discovered objects on the SLES server. 8. In Navigation, click Performance View. 9. In the lower pane, check several performance counters to see performance data. Your performance data may vary depending on the timing of this lab. 10. Close the Performance window and the Diagram View window. 11. Under monitoring, navigate to UNIX/Linux Computers/Linux/Logical Disk State. This view shows the health of logical volumes across all Linux servers. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 6
Implement monitoring on a new Linux server In this task, you will configure Operations Manager to monitor a newly installed Linux server named SLESNew. 1. In Operations Manager, click Administration. 2. Above Administration, click Discovery Wizard. 3. In Discovery Type, click UNIX/Linux computers, and then click Next. 4. In Discovery criteria, click Add. 5. Double-click the empty line in Discovery scope. 6. In Host name, type slesnew, and then click Save. 7. In Credentials, click Set credentials. 8. Click User name and password. 9. In user name, type root. 10. In Password and Confirm password, type Passw0rd! 11. Click OK, and then click Save. 12. In Select target resource pool, select All Management Servers Resource Pool, and then click Discover. Discovery may take a few minutes to complete. 13. Check SLESNew, and then click Manage. 14. When the deployment is complete, click Done. It may take up to 30 minutes (but most likely between 5 and 10) before SLESNew is fully recognized and available in the Operations Manager console. You may check the UNIX/Linux Computers node under Monitoring to see the newly added server. Initially it will appear grey but as the assorted monitoring and polling cycles complete, and information is gathered, it will report more detailed health status. Explore built-in native Linux monitoring In this task, you will explore the native Linux monitoring available with the Linux/Unix management packs. In this task you will terminate the CRON service on the SLES server, and then use Operations Manager to resolve the issue. 1. In Operations Manager, click Monitoring, and then click UNIX/Linux Computers (the object, not the folder). Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 7
2. Under Tasks, click Health Explorer. 3. On the menu bar, click Filter Monitors. This will remove all filters. 4. Navigate to Availability/Operating System/Availability, and then note the value of Process Cron Service Health. 5. Close Health Explorer. 6. Switch to SLES, and then ensure you are logged on as Root root using the password PasswordPassw0rd!. 6. Both the username and password are case sensitive. Formatted: Caution 7. Click Computer, and then click GNOME Terminal. 8. Type the following commands, pressing ENTER after each one All commands are case sensitive. The output of the first command will produce a number, such as 3456. Replace the value <PID> in the second command with this number. ps e grep cron kill -9 <PID> 9. Switch to Admin, and then in Operations Manager Console, click UNIX/Linux Computers. Wait for the state of sles.contoso.com to change to Critical. Wait approximately 15 seconds. In this lab environment, the polling interval has been reduced to 15 seconds to speed up results. If after a minute or so, the state of the parent object does not change to critical, proceed with the subsequent steps. It may take a while longer for the status of the parent eventobject to change to critical. 10. Under Tasks, click Health Explorer. 11. On the menu bar, click Filter Monitors. This will remove all filters and show healthy as well as unhealthy monitors. Note that this step is unnecessary if the state of sles.contoso.com is critical. 11.12. Navigate to Availability/Operating System/Availability, and note the value of Process Cron Service Health. The Process Core Service Health should have a critical status. Formatted: Additional Information 12.13. In the contents pane, click State Change Events. Here you can review a history of the monitor, as well as any recent status change events. The history shows a few status changes. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 8
13.14. In Details, scroll to the very bottom of the details window. You can review the output of the Cron status diagnostic. This monitor also includes an option to remediate the issue. 14.15. Click Cron restart, and then click Yes. 15.16. Scroll to the bottom of the Details pane, and note the status of the Cron restart. You will see in the recovery output area, that the daemon was restarted. 16.17. Close Health Explorer. 17.18. Wait for the state of sles.contoso.com to change to Healthy. Wait approximately 15 seconds. (Optional) Create a custom shell script-based monitor In this task, you will use a simple shell script to create a custom monitor which validates the status of an application by reviewing its log files. This simple example shows how you can leverage simple, or complex, shell scripting to monitor any aspect of a UNIX/Linux computer. Begin this task logged on to Admin as Contoso/Administrator using the password Passw0rd! 1. In Operations Manager Console, click Authoring. 2. Either scroll to, or use search to locate SUSE Linux Enterprise Server 11 Operating System. 3. Expand SUSE Linux Enterprise Server 11 Operating System, expand Entity Health, and then click Availability. 4. In Tasks, click Create a Monitor, and then click Unit Monitor. 5. In Monitor type, navigate to Scripting/Generic/UNIX/Linux Shell Command Two State Monitor. 6. In Management pack, click New. 7. In Name, type AppState Monitors, and then click Next. 8. Click Create. 9. In the Create a unit monitor wizard, click Next. 10. On the General page, in Name, type AppState, and then click Next. 11. In Schedule, change Minutes to Seconds, and then click Next. 12. In Shell Command Details, type the following command. The command is case sensitive. Cat cat /tmp/appstate grep ERROR wc l Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 9
To avoid ambiguity, the last character in the above command is the lower-case letter L, not the number 1. Formatted: Caution Formatted: Font: Bold 13. Click Next. 14. In Error Expression, on the first line, change Contains to Equals, and then in Value, type 1. The correct configuration is shown below. 15. Click Next. 16. In Healthy Expression, on the first line, change Contains to Equals, and then in value, type 0. The correct configuration is shown below. 17. Click Next two times, and then click Create. Validate the custom monitor In this task, you will validate that your custom monitor is working as expected. Begin this task logged on to SLES as Root root using the password Passw0rd! 1. Click Computer, and then click GNOME Terminal. 2. In GNOME Terminal, type the following command, and then press ENTER. Cat cat > /tmp/appstate The command is case sensitive. Formatted: Caution 3. Type OK on the blank line, and then press ENTER. 4. Press CTRL+D to save the file. 5. Switch to Admin, and ensure you have the Operations Console open. 6. Click Monitoring, and then click UNIX/Linux Computers. Depending on the speed at which you completed the previous tasks, your computer may have a status of either Healthy or Critical. Either is fine at this stage. 7. Under Tasks, click Health Explorer. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 10
8. On the toolbar, click Filter Monitors to remove all filters. 9. Navigate to Availability/Operating System/Availability, and then note the AppState monitor. 10. Close Health Explorer. CAUTION: Do not proceed until SLES.contoso.com shows healthy. If it does not show healthy, double check the steps you completed in the previous exercise. 11. Switch to SLES. 12. In GNOME Terminal, type the following command, and then press ENTER. Cat cat > /tmp/appstate 13. Type ERROR on the blank line, and then press ENTER. 14. Press CTRL+D to save the file. 15. Switch to Admin. Wait for the SLES computer to switch to CRITICAL. This indicates it has used the custom monitor shell script to identify the ERROR in the appstate log file. 16. In GNOME Terminal, type the following command, and then press ENTER. Cat cat > /tmp/appstate 17. Type OK on the blank line, and then press ENTER. 18. Press CTRL+D to save the file. 19. Switch to Admin. Wait for SLES.contoso.com to switch to Healthy. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 11
Exercise 2: Managing Linux with System Center 2012 R2 Configuration Manager In this exercise, you will use System Center 2012 R2 Configuration Manager to deploy software to a new Linux server. You will first deploy the Configuration Manager Agent software to SLESNew. Since the software takes time to fully register with Configuration Manager, you will then proceed to deploy a new Java package to SLES using software distribution. Install the Configuration Manager Linux client In this task, you will install the Configuration Manager client on SLESNew, and then approve it as a Configuration Manager client. Begin this task logged on to SLESNew as Root root with the password Passw0rd! 1. Click Computer, and then click More Applications. 2. Under System, click GNOME Terminal. 3. In Terminal, type the following commands, pressing ENTER after each one. IMPORTANT: All commands are CASE SENSITIVE. cd Documents./install mp cm.contoso.com sitecode CTO ccm- Universalx86.1.0.0.4580.tar 4. Switch to the Admin VM, and then ensure you are logged on as Contoso\Administrator using the password Passw0rd! 5. Open the Configuration Manager console. 6. In Assets and Compliance, click Devices. 7. In the content pane, click SLESNew.contoso.com. 8. On the ribbon, click Device, and then click Approve. 8. Depending on your display, you may not see Device on the ribbon. If this is the case, click Approve. Formatted: Additional Information 9. Click Yes. Manually added devices must be approved by the Configuration Manager administrator before being managed. Management will now collect inventory information from the SLES computer. This process may take anywhere from 10 minutes to 1 hour 10. Leave Terminal open for a future step. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 12
Review hardware inventory In this task, you will review the hardware inventory collected on the SLES computer. You will switch away from using SLESNew so you do not have to wait for this process to complete. The Configuration Manager Agent has already been deployed on this computer, and time was taken to allow the various management processes to run. 1. In the Configuration Manager console, click Device Collections. 2. In the contents pane, double-click SLES Servers. 3. Right-click SLES, click Start, and then click Resource Explorer. 4. In Resource Explorer, navigate to SLES/Hardware/Installed Applications. Note the list of installed Linux packages. 5. Click Services. Note the list of running services and pathnames. Note that CCMExec is a running service. Deploy a Java RPM package to SLES In this task, you will create a Java Runtime Environment (JRE) package to install on SLES using Configuration Manager. 1. In the Configuration Manager console, click Software Library. 2. Expand Application Management, and then click Packages. 3. Right-click Packages, and then click Create Package. 4. In the Create Package and Program wizard, in Name, type JRE Package. 5. Check This package contains source files, and then click Browse. 6. In Source folder, type \\Admin\Downloads. The JRE package already exists in this location. It was downloaded previously. 7. Click OK. 8. Click Next. 9. In Program Type, click Next. 10. In Standard Program, in Name, type JRE Installer. 11. In Command line, click Browse. 12. Change Executable Files (*.exe) to All Files (*.*). Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 13
13. Click the JRE package file, and then click Open. This method ensures you are capturing the name of the package file exactly, including case, which must match. 14. At the command prompt, insert the text rpm ivh before the.rpm file name. Your command should read as follows: rpm ivh jre-7u40-linux-i586.rpm This command is case-sensitive. 15. In Program can run, select Whether or not a user is logged on. 16. Click Next. 17. In Requirements, click Next. 18. In Summary, click Next, and then when the packages is created, click Close. Distribute the JRP JRE package In this task, you will copy the JRE package to your distribution point. 1. In Packages, click JRE Package, and then click Properties. 2. In Distribution Settings, click Automatically download content when packages are assigned to distribution points, and then click OK. 3. In Packages, click JRE Package, and then on the ribbon, click Distribute Content. 4. In the Distribute Content Wizard, click Next. 5. On the Content Distribution page, click Add, and then click Distribution Point. 6. Check cm.contoso.com, and then click OK. 7. Click Next on all remaining pages, and then click Close. 8. In Packages, click JRE Package, and then press F5. This will refresh the content status view to track content distribution process. Keep pressing F5 every few seconds until the content status is green. This should take no more than 1 minute. Verify JRE is not installed on SLES In this task, you will use the GREP command to verify that JRE is not installed on SLES. Begin this task logged on to SLES as Root root with the password Passw0rd! 1. Click Computer, and then click GNOME Terminal. 2. In Terminal, type the following command, and then press ENTER. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 14
This command is case sensitive. rpm qa grep jre Note that there is no jre package listed. 3. Leave Terminal open for the next step. Create new device collection for SUSE Servers In this task, you will create a new collection that contains both the SLES and SLESNew servers.. 1. In the Configuration Manager console, click the Assets and Compliance workspace. 2. Click Device Collections. 3. On the ribbon, click Create Device Collection. 4. On the Specify details for this collection page, in Name, type All SLES Servers. 5. For Limiting collection, click Browse. 6. In the Select Collection dialog box, click All Systems, and the click OK. 7. On the Specify the details for this collection page, click Next. 8. On the Define membership rules for this collection page, click Add Rule, and then click Direct Rule. To simplify the creation of this collection, we are using a Direct Rule. In a production environment, you would likely want create a query rule that would dynamically update the membership of the collection as Linux Servers are added and removed. 9. On the Welcome page, click Next. 10. On the Locate resources to add to the collection page, click the Attribute name drop down, and select Operating System Name and Version. 11. In Value, type SLES%. 12. Click Next. 13. On the Select resources to add as direct members to this collection, check sles and slesnew, and click Next. Do not select the entries for sles (Obsolete), if they are present. 14. On the Confirm the settings page, click Next. 15. Click Close. 16. On the Define the membership for this collection page, click Next. 17. Click Next, and then click Close. Formatted: Numbered + Level: 1 + Numbering Style: 1, 2, 3, + Start at: 1 + Alignment: Left + Aligned at: 0.25" + Tab after: 0.5" + Indent at: 0.5" Formatted: Additional Information Formatted: Caution Formatted: Font: Bold Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 15
Deploy the JRE package to SLESthe All SLES Servers collection In this task, you will deploy the JRE package to the All SLES Servers collection. 4.1. In the Configuration Manager console, click JRE Package. 5.2. On the ribbon, click Deploy. Formatted: Numbered + Level: 1 + Numbering Style: 1, 2, 3, + Start at: 1 + Alignment: Left + Aligned at: 0.25" + Tab after: 0.5" + Indent at: 0.5" 6.3. In General, next to Collection, click Browse. 7.4. Click All SLES servers, and then click OK. 8.5. Click Next. 9.6. On Content, click Next. 10.7. On Deployment Settings, click Next. 11.8. In Scheduling, click New. 12.9. Click Assign immediately after this event, and then click OK. 13.10. Click Next. 14.11. On User Experience, click Next. 15.12. On Distribution Points, click Next. 16.13. On Summary, click Next, and then click Close. 14. Switch to SLES. Ensure you are logged on as Rootroot, and that Terminal is open. 17. Formatted: Additional Information /opt/microsoft/configmgr/bin/ccmexec rs policy The command is case sensitive and must be typed exactly as shown. This command forces a policy evaluation cycle on the Configuration Manager client. The software installation will commence after the next policy cycle is complete, however you may not see the software installed for up to 10 minutes or more. Verify JRE is installed In this final task, you will verify that JRE is installed on SLES. It is important to note that this task may not produce results for up to 10 minutes after the previous task has been run. 1. In Terminal, type the following command, and then press ENTER. This command is case sensitive. rpm qa grep jre Note that there is now a JRE package installed. Lab created by HynesITe, Inc. For questions or comments, send an email message to labs@holsystems.com Page 16