Altiris Notification Server

Notification Server Maintenance


Last update: 07/13/06


Notice

The content in this document represents the current view of Altiris as of the date of publication. Because Altiris responds continually to changing market conditions, this document should not be interpreted as a commitment on the part of Altiris. Altiris cannot guarantee the accuracy of any information presented after the date of publication.

Copyright © 2006, Altiris, Inc. All rights reserved.

Altiris, Inc.

588 West 400 South

Lindon, UT 84042

Phone: (801) 226-8500

Fax: (801) 226-8506

BootWorks U.S. Patent No. 5,764,593.

RapiDeploy U.S. Patent No. 6,144,992.

Altiris, BootWorks, Inventory Solution, PC Transplant, RapiDeploy, and RapidInstall are registered trademarks of Altiris, Inc. in the United States.

Carbon Copy is a registered trademark licensed to Altiris, Inc. in the United States and a registered trademark of Altiris, Inc. in other countries.

Microsoft, Windows, and the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries.

Other brands and names are the property of their respective owners.

Information in this document is subject to change without notice. For the latest documentation, visit www.altiris.com.

Table of Contents

Table of Contents 3

SQL Maintenance Plan 4

SQL Memory Management 6

Installing the NSConfigurator Utility 6

NSConfigurator 7

Event Queue Thread Settings 7

Installing the Diagnostics MSI 8

Running the Log Viewer 9

Running the Altiris Profiler 11

Purging plans 12

Merging Reports for Duplicate Computers 15

Performance metrics - Perfmon 20

Event queues 21

Reports 21

Altiris Agent Installation Status Reports 21

Altiris Agent Inventory 22

Altiris Agent Package Info Request 23

Configuration Request 24

Inventory Analysis Reports 25

Inventory Forwarding 26

Package Server Status 27

Server Performance Reports 28

Site Reports 29

Server Performance Report 30

Logs 34

Notification Policies 36

Index Tuning 37


This document out lines some basic performance settings that should be done to help optimize the performance of the Altiris Notification Server. Many of these items are a one-time setting creating an automated process and then performance monitoring tools, reports and logs can be used to frequently monitor the overall health of the NS.

SQL Maintenance Plan

A SQL Maintenance Plan should be created to backup database and transaction log frequently. The database should be backed up daily. The transaction log should be backed up more frequently in order to truncate the transaction log which can growing enormously during certain SQL processes. A simple maintenance plan will create a checkpoint and force the transaction log to commit its changes and truncate.

Defragging Indexes should be done on a weekly basis. This can be done as part of the SQL Maintenance Plan or a SQL script can be provided to run this as a scheduled task. See the script to defrag the indexes at the end of this section.

Note: “Removed unused space from the database files” should NOT be selected as it causes unnecessary load on the SQL Server.

The plan should also include database integrity checks that include the indexes.

WARNING: If “Attempt to repair any minor problems” is selected, the maintenance plan may fail if users are connected to the database attempts to put the maintenance plan into single user mode.

Below is a script that can be ran regularly on the NS that will defrag the SQL Indexes.

Index Defragging Script
declare @index_name nvarchar(255)
declare @table_name nvarchar(255)
declare index_cursor cursor for
select
si.name as index_name,
object_name(si.id) as table_name
from sysindexes si
left outer join sysobjects so on so.name=si.name
where objectproperty(si.id, N'IsUserTable') = 1
and objectproperty(si.id, N'IsUserTable') = 1
and si.name > object_name(si.id)
and si.impid > -1
open index_cursor
fetch next from index_cursor into @index_name, @table_name
while @@FETCH_STATUS = 0
begin
print 'Attempting defrag of index [' + @index_name + '] on table [' + @table_name + ']'
dbcc INDEXDEFRAG( 0, @table_name, @index_name )
fetch next from index_cursor into @index_name, @table_name
end
close index_cursor
deallocate index_cursor

SQL Memory Management

Depending upon the versions of the operating system and SQL Server and the amount of memory in the SQL Server, memory management techniques can be used to optimize the memory usage of SQL. These techniques include:

4-gigabyte tuning - /3GB

Physical Address Extension - PAE

Address Windowing Extensions – AWE

Please refer to the SQL Tuning and Performance document for additional details.

Installing the NSConfigurator Utility

The NSConfigurator Utility should be used to make changes to any of the settings in the coresettings.config file to reduce the chance of file corruption. The MSI (NSConfigurator.msi) to install this utility is located in the “Program Files\Altiris\diagnostics” directory on the NS 6.0 SP3 server.

NSConfigurator

The NSConfigurator utility can be launched by clicking “Start – Programs – Altiris – Tools – NSConfigurator”.

Event Queue Thread Settings

The default thread settings for the EvtQueue and EvtQFast queues are too aggressive and can cause SQL deadlocks to occur which are often caused by threads attempting to access a table that is currently being accessed by another thread. In the Notification Server\Config\CoreSettings.conf file are two settings that should be adjusted according to the number of processes in the Notification Server.

Please save a copy of the original CoreSettings.config file before editing. Open the CoreSettings.config file using the NSConfigurator. WordPad or MSWord will embed hidden characters into the XML rendering it bad.

<customSetting key="MaxConcurrentFastMsgs" type="local" value="10" />

<customSetting key="MaxConcurrentSlowMsgs" type="local" value="3" />

·  For the EvtQueue (MaxConcurrentSlowMsgs) the value should equal the number of processors in the machine divided by 2 (= to ½ the number of processors)

·  For the EvtQFast (MaxconcurrentFastMsgs) the value should be equal to the number of processors in the machine.

NOTE: The settings listed above are CASE sensitive. Do not change the existing CASE formatting when changing the values.

NOTE: The above details are a starting point. Depending on the environment these settings should be tweaked to find the optimal settings.

Installing the Diagnostics MSI

NS SP3 installs an AltirisDiagnostics.msi that included a new Altiris Log Viewer and a new
Altiris Profiler utility. These utilities can be accessed by clicking “Start – programs – Altiris – Diagnostics” and selecting either the Altiris Log Viewer or Altiris Profiler. The log viewer will display a runtime view of the errors, warning, information, and trace messages that are occurring real time.

The Altiris Profiler is a utility that allows the capturing of SQL and Code traces. These traces are used is troubleshooting and determining the state of the NS.

Running the Log Viewer

The log viewer lists the events that are occurring real time. Events in red are errors, events in blue are warning, events in black are informational and events in gray are trace messages.

In order for the specific event types in the quick filters to appear, the registry setting for the error logging must be configured properly. In other words, if you want trace events to appear, the registry setting for error logging must be configured for trace logging. The registry location is found at HKEY_Local_Machine\SOFTARE\Altiris\express\Event Logging\LogFile.

1 = error

2 = warning

4 = informational

8 = trace

Severity = 7 (1 + 2 + 4)

Severity = f(hex) – 15(decimal) (1 + 2 + 4 + 8)

Running the Altiris Profiler

These Altiris Profiler can be accessed by clicking “Start – programs – Altiris – Diagnostics” and selecting “Altiris Profiler”.

Please refer to the documentation written on using the Altiris Profiler.

Shows code trace events:

Shows SQL trace events

Purging plans

All Notification Server functions revolve around the data stored in the Altiris database. The integrity of the data is critical to the integrity of all NS functions and reports. Various types of data get stored in the database. As data ages, it is important that specific types of date are purged from the database. SQL Performance is greatly affected by the amount of data it has to parse.

NS 6.0 SP3 provides a single location for configuring purging schedules for each of the NS components and solutions. Under the Configuration tab – Server Settings – Notification Server Settings is a Purging Maintenance task that brings up a web page for configuring these settings.

By default these settings are configured to purge data older than 6 months or a max of 1000000 rows. These settings should be adjusted to the requirements of your reporting needs.

Below is a SQL query that will generate a report that will show each table in the Altiris database, the number of rows, and space consumed. It might be useful to run this query frequently to get a snapshot of your database state to determine whether the purging processes should be tweaked in order to reduce overhead for the reporting process.

SET NOCOUNT ON

/*DATABASE TABLE SPY SCRIPT

SORTING USAGE

@Sort bit VALUES

0 = Alphabetically BY TABLE name

1 = Sorted BY total space used by TABLE

*/

DECLARE @cmdstr varchar(100)

DECLARE @Sort bit

SELECT @Sort = 1 /* Edit this value FOR sorting options */

/* DO NOT EDIT ANY CODE BELOW THIS LINE */

--Create Temporary Table

CREATE TABLE #TempTable

( [Table_Name] varchar(50),

Row_Count int,

Table_Size varchar(50),

Data_Space_Used varchar(50),

Index_Space_Used varchar(50),

Unused_Space varchar(50)

)

--Create Stored Procedure String

SELECT @cmdstr = 'sp_msforeachtable ''sp_spaceused "?"'''

--Populate Tempoary Table

INSERT INTO #TempTable EXEC(@cmdstr)

--Determine sorting method

IF @Sort = 0

BEGIN

--Retrieve Table Data and Sort Alphabet

-- ically

SELECT * FROM #TempTable ORDER BY Table_Name

END

ELSE

BEGIN

/*Retrieve TABLE Data AND Sort BY the size OF the Table*/

SELECT * FROM #TempTable ORDER BY Table_Size DESC

END

--Delete Temporay Table

DROP TABLE #TempTable

Below is an example of the output of the query. Data is listed by descending row count.

Note: If SWD Status events need to be captured, this is one event that can cause the Evt_AeX_SWD_Status table to grow large. Be sure to set the purging on this event so that these events are purged frequently.

Merging Reports for Duplicate Computers

There are different ways that computers can be inserted into the Altiris database. This frequently causes duplicate computers to be created. The Active Directory Import and Domain Discovery processes are a couple of the most common offenders. Importing computers into Asset Management can also create duplicates between an imported computer and an active computer.

In the Configuration Tab – Server Settings – Notification Server Infrastructure – Merge Computers folder is a “Merge computers with duplicate names” task. This task generates a report that lists computers that have duplicates in the database. Clicking on these computers manually provides the ability to merge an old computer record with a new record computer record.

Running the merge through the task is a manual process. Below is a SQL script than can be run through query analyzer that will perform the merging automatically. A stored procedure could be created from this query if desired and then scheduled to run regularly. This task is very SQL intensive and should be run at a time that minimal processing is occurring.

DECLARE @MergeName nvarchar(400)

DECLARE @MergeDomain nvarchar(400)

DECLARE @FromGuid uniqueidentifier

DECLARE @ToGuid uniqueidentifier

DECLARE @PrimaryResource UNIQUEIDENTIFIER

PRINT 'The following script will automatically merge resources as per the ''Merge computers with duplicate names'' report.'

PRINT 'The merge automatically chooses the resource that has the most recent update.'

DECLARE merge_cursor CURSOR FOR

SELECT Ident.[Name], Ident.[Domain] FROM Inv_AeX_AC_Identification Ident

INNER JOIN

(

SELECT Ident1.[_ResourceGuid], Ident1.[Name], Ident1.[Domain] FROM Inv_AeX_AC_Identification Ident1

INNER JOIN Inv_AeX_AC_Identification Ident2 ON Ident2.[Name] = Ident1.[Name] AND Ident2.[Domain] = Ident1.[Domain] AND Ident2.[_id]!= Ident1.[_id]

INNER JOIN vComputerResource Ident3 ON Ident1.[_ResourceGuid] = Ident3.[Guid]

GROUP BY Ident1.[_ResourceGuid], Ident1.[Name], Ident1.[Domain]

) udr ON Ident.[_ResourceGuid] = udr.[_ResourceGuid]

GROUP BY Ident.[Name], Ident.[Domain]

OPEN merge_cursor

FETCH NEXT FROM merge_cursor

INTO @MergeName, @MergeDomain

WHILE @@FETCH_STATUS = 0

BEGIN

PRINT 'Merging ' + @MergeName + '.' + @MergeDomain

CREATE TABLE #DUPLICATE_NAME (Resource UNIQUEIDENTIFIER, [Primary] BIT, [Name] NVARCHAR(64), [Domain] NVARCHAR(64), LastUpdated DATETIME, [OS Name] NVARCHAR(64))

INSERT INTO #DUPLICATE_NAME

SELECT ident1.[_ResourceGuid] AS [Resource], CAST (0 AS BIT) AS [Primary], ident1.[Name], ident1.[Domain], md.[ModifiedDate] AS [LastUpdated], ident1.[OS Name] FROM Inv_AeX_AC_Identification ident1

JOIN

(

SELECT ident2.[Name], ident2.[Domain] FROM Inv_AeX_AC_Identification ident2

GROUP BY ident2.[Name], ident2.[Domain]

HAVING COUNT (ident2.[Name]) > 1 AND ident2.[Name] = @MergeName AND ident2.[Domain] = @MergeDomain

) dr ON ident1.[Name] = dr.[Name] and ident1.[Domain] = dr.[Domain]

LEFT OUTER JOIN

(

SELECT DISTINCT rus.[ResourceGuid], rus.[ModifiedDate] FROM ResourceUpdateSummary rus

JOIN

(

SELECT rus2.[ResourceGuid], MAX( rus2.[ModifiedDate] ) AS ModifiedDate FROM ResourceUpdateSummary rus2

GROUP BY rus2.[ResourceGuid]

) td ON td.ResourceGuid = rus.ResourceGuid AND td.ModifiedDate = rus.ModifiedDate

) md ON ident1.[_ResourceGuid] = md.[ResourceGuid]

SELECT TOP 1 @PrimaryResource = Resource FROM #DUPLICATE_NAME ORDER BY [LastUpdated] DESC

UPDATE #DUPLICATE_NAME SET [Primary]=1 WHERE Resource = @PrimaryResource

/*SELECT * FROM #DUPLICATE_NAME ORDER BY [LastUpdated] DESC*/

SELECT TOP 1 @ToGuid = Resource FROM #DUPLICATE_NAME where Name = @MergeName and Domain = @MergeDomain and [Primary] = '1'

SELECT TOP 1 @FromGuid = Resource FROM #DUPLICATE_NAME where Name = @MergeName and Domain = @MergeDomain and [Primary] = '0'

DROP TABLE #DUPLICATE_NAME

exec spResourceMerge @FromGuid,@ToGuid

FETCH NEXT FROM merge_cursor

INTO @MergeName, @MergeDomain

END

CLOSE merge_cursor

DEALLOCATE merge_cursor

In the “Tasks – Assets and Inventory – Merge Assets” folder are three other merge tasks. These tasks merge an inactive computer that has been imported/created in asset management with an active computer than has sent inventory to the NS.

In order for these tasks to report properly the “Inventory to Asset Data Synchronization” task must be run.

These merge tasks are also manual processes. The SQL script below can be run to automate the task of merging computers having the same serial number:

DECLARE @MergeSerialNumber nvarchar(100)

DECLARE @MergeResourceTypeGuid uniqueidentifier

DECLARE @FromGuid uniqueidentifier

DECLARE @ToGuid uniqueidentifier

DECLARE @PrimaryResource UNIQUEIDENTIFIER

Print 'The following script will automatically merge resources as per the "Merge computers with duplicate serial numbers” report.'