23
May 2005 Deploying Dell Open Manage Server Administrator from IT Assistant 7.0 Enterprise Systems Group (ESG) Dell OpenManage™ Systems Management Dell White Paper By Annapurna Dasari [email protected]

Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

May 2005

Deploying Dell Open Manage Server

Administrator from IT Assistant 7.0

Enterprise Systems Group (ESG)

Dell OpenManage™ Systems Management

Dell White Paper

By Annapurna Dasari

[email protected]

Page 2: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 2 Dell Enterprise Systems Group

Contents 1. Introduction............................................................................................................................... 2. Deploying Dell Open Manage Server Administrator from IT Assistant ......................

2.1 WMI Install Script ............................................................................................................ 2.2 Creating a Generic CLI Task to Run the WMI Install Script. .................................... 2.3 Task Execution Results:................................................................................................... 2.4 Verify Installation ............................................................................................................ 2.5 Copying the MSI package on to the target node .........................................................

3. Conclusion: ................................................................................................................................. Appendix..........................................................................................................................................

Tasks in IT Assistant................................................................................................................. Windows Management Instrumentation .............................................................................

Page 3: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 3 Dell Enterprise Systems Group

1. Introduction

IT Assistant is a central management console that manages and monitors systems in a corporate network. In addition to the basic discovery of systems it supports a wide variety of advanced systems management tasks such as software inventory, software updates, device control, reporting, event management and system health monitoring. It does so by communicating with and delegating work to the Dell Open Manage Server Administrator agents on the individual managed nodes. Hence the first step in setting up this fully centralized management environment is the deployment of the Dell Open Manage agent (Server Administrator) software on each managed node. This whitepaper presents a generic method of deploying the agent software from the IT Assistant’s central console itself. This method uses WMI (windows management instrumentation) scripts and tasks in IT Assistant to deploy the agent software (MSI package) on to a remote node. We call it a generic method as it can be used to deploy any standard windows software/service pack (packaged as an MSI or MSP) from the central console.

Page 4: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 4 Dell Enterprise Systems Group

strComputer = WScript.Arguments.Item(0)

strCommand = WScript.Arguments.Item(1)

strUserName = WSCript.Arguments.Item(2)

strPassword = WScript.Arguments.Item(3)

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")

Set objSwbemServices = objSWbemLocator.ConnectServer(strComputer,

“root\cimv2", strUserName , strPassword)

Set objSWbemObject = objSWbemServices.Get("win32_Process")

errReturn = objSWbemObject.Create(strCommand,null,null,intProcessID)

if errReturn = 0 Then

Wscript.Echo strCommand & " was started with a process ID of " _

& intProcessID & "."

Else

Wscript.Echo strCommand & " could not be started due to error " &

errReturn & "."

End If

2. Deploying Dell Open Manage Server Administrator from IT Assistant

This section walks you through a step-wise procedure for creating a WMI task that deploys Dell Open Manage agent software on a remote managed system from IT Assistant. Note that this task can be performed via IT Assistant in a number of methods – this paper illustrates one of the standard methods of doing so.

2.1 WMI Install Script The first step in deploying Dell Open Manage Server Administrator is to develop a WMI script that installs the Dell Open Manage Agent MSI package. Shown below is a generic WMI based vbscript that can run a given process on a given system with the given credentials.

Page 5: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 5 Dell Enterprise Systems Group

The above script accepts 4 input arguments. The first argument is the hostname/IP address of the remote node on which the process needs to be executed, the second argument is the process that is to be executed remotely and the third and forth arguments correspond to the credentials to be used to spawn the process. It outputs the process ID of the remote process upon successful execution; otherwise it returns the error code. We will be using this script to silently install the Dell Open Manage Agent MSI package. Note: This script assumes that the Dell Open Manage Agent installation files (MSI package and cab files contents of the Dell Open Manage Managed Node CD) already exist on the target machine in the directory C:\tmp. If you need to copy the files on to the target machine then refer to the section “Copying the MSI package on to the target node”, before proceeding further.

2.2 Creating a Generic CLI Task to Run the WMI Install Script. Next we need to execute the above script on a remote node by creating a task in IT Assistant. We will create a generic CLI (command line task) to execute this script with the appropriate parameters. The following discussion guides you through the wizards for creating the task in IT Assistant.

Page 6: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 6 Dell Enterprise Systems Group

Step 1: Choose the task type as generic CLI command line task and enter the name and brief description of the task

Page 7: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 7 Dell Enterprise Systems Group

Step 2: Enter the name of the executable to be executed and its arguments. In this case cscript is the executable that executes WMI script remoteexec.vbs located in C:\scripts. In the arguments sections, enter the name and location of the script to be executed followed by the arguments to the script. The WMI script takes the following four arguments:

1. Target Device(s): Hostname or IP Address of the target system(s) on which, the Dell Open Manage Agent software needs to be installed. You can use $IP or $NAME to select devices from the device selection pane.

2. MSI Install Command: The second argument is the silent installation command for the SysMgmt.msi located in C:/tmp on the target device. The silent install command that is shown in the screenshot: msiexec.exe /i c:\tmp\SysMgmt.msi /l*v “C:\install.log” /qn, installs the complete msi package and writes the log to file C:\install.log. One can pass options to install specific components of the MSI package. Please refer to the server administrator installation guide for more information on different silent install options.

3. Username: Name of the user running the WMI script on the remote node. 4. Password: Password of the user running the WMI script. You can use

$USERNAME and $PASSWORD to pass the credentials securely using the authentication pane in IT Assistant.

Page 8: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 8 Dell Enterprise Systems Group

Page 9: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 9 Dell Enterprise Systems Group

Step 3: Select the target device either from the device tree or by running a query.

Note: You can select more than one target device for the task. In this case the script will be executed on each of the target nodes with the same parameters except for the first parameter, which will change depending on the device the task is being run. For multi-select to work, the MSI should be located at the same location on all target devices and the same credentials should apply.

Page 10: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 10 Dell Enterprise Systems Group

Step 4: Select the time to run the task.

Page 11: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 11 Dell Enterprise Systems Group

Step 5: Enter the credentials with which the task needs to be run on the remote node.

Page 12: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 12 Dell Enterprise Systems Group

Step 6: Review the summary of the task and click finish if no changes are required.

Page 13: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 13 Dell Enterprise Systems Group

2.3 Task Execution Results: Once the task executes, you can see the execution results by switching to the execution log tab. You can see the standard output and standard error of the process that executed the task on the remote node. Shown below is a screen shot of successful execution of the above task.

Page 14: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 14 Dell Enterprise Systems Group

2.4 Verify Installation The output of the task only reveals if the installation was started successfully; it does not have any information about how and when the installation completed. This is because the task we executed is an asynchronous task that only spawns the MSI installation and does not wait for it to complete. One simple method to verify if the installation went successfully is to wait for the installation to complete (typically takes about 5- 15 minutes depending on the components being installed) and then perform inventory of the target node or the range (that includes the target node). The screenshots below illustrate this.

Page 15: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 15 Dell Enterprise Systems Group

Once the inventory task has been performed, we can see that the target node is moved to the servers group, indicating successful installation of Dell Open Manage Server Administrator on the remote node. However if the remote node does not show up in the servers group, we can assume that the installation failed. Common reasons for the install failure are:

1. Invalid Credentials: The credentials passed to the WMI script are invalid or do not have the sufficient privileges to run the intended WMI task of installing Dell Open Manage Agent software.

2. Remote WMI problem: The WMI service on the target machine has not started or is not configured properly. Default WMI configuration is sufficient for this script to work.

3. Connectivity Issues: The management station is unable to communicate with the target node because of networking problems. Running the Ping connectivity test from the troubleshooting tool can help identify and resolve such issues.

4. MSI Errors: The installation can fail because of MSI errors generated while installing the SysMgmt.msi package. Such errors are written to the

Page 16: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 16 Dell Enterprise Systems Group

install log file, specified in the silent install command using the “/l” option. You can diagnose the failure by obtaining information on the MSI error code that is written to the install log file on the target machine.

5. SNMP Configuration Problems: If SNMP is not configured properly on the target node, it will not be identified as a server even if the installation went successfully. You can run the SNMP connectivity test from the troubleshooting tool to check if SNMP is configured properly on the target node. You can set SNMP settings on the target node remotely from the management station using a WMI script. The following script configures SNMP settings on the target node by setting the appropriate registry keys.

‘Script changes SNMP settings for a specified host.

'==================================

' Please specify the following:

dwAuthenticationTrapsvalue = 0

strCommunityName = "my community"

dwCommunityType = 8

strTrapDesitinationAddress = "143.166.134.223"

'===================================

strComputer = WScript.Arguments.Item(0)

const HKEY_CURRENT_USER = &H80000001

const HKEY_LOCAL_MACHINE = &H80000002

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &

"\root\default:StdRegProv")

' Set the Enable Authentication Traps Value

strKeyPath = "SYSTEM\CurrentControlSet\Services\SNMP\Parameters"

strValueName = "EnableAuthenticationTraps"

dwAuthenticationTrapsvalue = 0

oReg.SetDWORDValue

HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwAuthenticationTrapsvalue

WScript.Echo "Enable Authentication Traps: " & dwAuthenticationTrapsvalue

Page 17: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 17 Dell Enterprise Systems Group

‘ Set the Community Info

strKeyPath = "SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities"

oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strCommunityName,

dwCommunityType

WScript.Echo "Community Info Set: " & strCommunityName & " of type: " &

dwCommunityType

' Set the Trap Desitination Address

strKeyPath = "SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\" &

strCommunityName oReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath

oReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, 1, strTrapDesitinationAddress

WScript.Echo "Added Trap Community Name: " & strCommunityName & " with destination

address: " & strTrapDesitinationAddress

'Accept SNMP Packets from any host

strKeyPath = "SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers"

oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath, "1"

WScript.Echo "Accept SNMP Packets from any host"

Page 18: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 18 Dell Enterprise Systems Group

2.5 Copying the MSI package on to the target node In the above task, we assumed that the installation files existed locally, on the managed node. If this is not the case, then we need to copy the installation files from the management station (local machine) onto the remote managed node. This step is mandatory, as the MSI installer may run into problems while installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy files from the local machine to the remote machine.

This script can also be run from IT Assistant using a generic CLI task as shown previously in steps 1 to 6. It takes IP Address of the target node as the single argument which must be entered as $IP in the arguments section in step 2. Select the target remote node(s) in step 3. Enter credentials corresponding to the user who has file copy rights on the remote machine in step 5. Typically the credentials supplied are that of a domain user who has appropriate privileges on both the source and target nodes.

Const OverwriteExisting=True

ipAddress=WScript.Arguments.Item(0)

strComputer = "."

Set objWMIService = GetObject("winmgmts:" &

"{impersonationLevel=impersonate}!\\" _

& strComputer & "\root\cimv2")

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set colFiles = objWMIService.ExecQuery _

("SELECT * FROM CIM_Datafile WHERE PATH = '\\scripts\\' ")

For Each objFile in colFiles

fileToCopy = objFile.Name

objFSO.CopyFile fileToCopy, "\\" & ipAddress & "\c$\tmp\",

OverwriteExisting

Wscript.Echo strCopy

Wscript.Echo objFile.Name

Next

Page 19: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 19 Dell Enterprise Systems Group

Note: The above script uses WMI impersonation hence can only be run from IT Assistant 7.1 or higher versions. If you are using IT Assistant 7.0, then we recommend running the copy script from the command prompt.

Page 20: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 20 Dell Enterprise Systems Group

3. Conclusion: As illustrated in this whitepaper, it is possible to execute a wide variety of systems management tasks such as installing and upgrading software, status monitoring, event management and so on using IT Assistant. Thus by enabling standards such as WMI, IT Assistant promises to provide a viable and complete systems management solution.

Page 21: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 21 Dell Enterprise Systems Group

4.0 Appendix 4.1 Tasks in IT Assistant

The task management component in IT Assistant provides a feature rich, robust and secure systems management interface that can be exploited by system administrators to efficiently manage systems in their enterprise. IT Assistant supports execution of different types of tasks and are classified based on their functionality as

(1) Generic Command Line— Used to execute generic remote command line tasks that are not specific to any agent.

(2) Remote Server Administrator Command Line— Used to execute Server Administrator command line interface (CLI) commands remotely.

(3) IPMI Command Line— Used to execute Intelligent Management Platform Interface (IPMI) CLI commands remotely.

(4) Remote Client Instrumentation— Used to execute Client Connector CLI commands remotely.

(5) Shutdown Device— Used to perform shutdown operation on selected devices.

(6) Wake Up Device—Used to wake up the specified device(s) on the port number you want to wake up. The wake up device task works by sending a ʺmagic packetʺ on a directed subnet address.

(7) Software Update— Used to perform a software update on one or more remote devices.

Page 22: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 22 Dell Enterprise Systems Group

4.2 Windows Management Instrumentation Windows Management Instrumentation provides a consistent way to access comprehensive systems management information. It does so using WMI infrastructure which consists of the WMI Providers, the WMI Service, the WMI repository and the WMI consumers. The WMI providers act as intermediary between the WMI Service (CIMOM) and a managed resource. They request information from and send instructions to WMI-managed resources on behalf of consumer applications and scripts. The WMI Service handles the interaction between the WMI consumers and WMI providers. The WMI repository stores the schema that defines all the management information exposed by WMI. The WMI consumers are scripts and application that access and control management information available through the WMI infrastructure. For each manageable resource there exists a WMI class that encapsulates its properties and the actions that WMI can perform to manage it. The managed resource that we will be accessing in our script is the win32_Process class which encapsulates the properties and actions that can be performed on a process in windows operating system.

This disclosure should be placed in a paragraph before the trademark sentence:

THIS WHITE PAPER IS FOR INFORMATIONAL PURPOSES ONLY, AND MAY CONTAIN TYPOGRAPHICAL ERRORS AND TECHNICAL INACCURACIES. THE CONTENT IS PROVIDED AS IS, WITHOUT EXPRESS OR IMPLIED WARRANTIES OF ANY KIND.

Page 23: Annapurna Dasari@dell · installing a remote package. We can run a WMI script that copies files on to the remote machine. Shown below is a sample WMI script that can be used to copy

August 2005 Page 23 Dell Enterprise Systems Group

Dell, OpenManage, PowerEdge, and PowerVault are trademarks of Dell Inc.

Other trademarks and trade names may be used in this document to refer to either the entities claiming the marks and names or their products. Dell disclaims proprietary interest in the marks and names of others.

©Copyright 2005 Dell Inc. All rights reserved. Reproduction in any manner whatsoever without the express written permission of Dell Inc. is strictly forbidden. For more information, contact Dell. Dell cannot be responsible for errors in typography or photography.

Information in this document is subject to change without notice.