ConfigMgr 2007 provides two built-in mechanisms for viewing and troubleshooting Configuration Manager operations:
ConfigMgr
components generate status messages to report milestone activity and
problem occurrences. System administrators can view status messages and
use them in queries and reports. You can also configure the status
message system to invoke automated actions in response to specified
status messages.
ConfigMgr components generate extensive logs that give additional detail about their activity.
Both the status message system and logging are highly configurable and provide valuable windows into the system.
Digging into ConfigMgr logs
is the best way to gain a deep understanding of ConfigMgr internals.
The ConfigMgr logs are text
files, and you can view them in Windows Notepad or your favorite text
editor. One of the most popular tools for previous versions of SMS,
however, has been the log viewer tool (Trace32). Most administrators
prefer to use the log viewer rather than a text editor to display log
files. An updated version of the log viewer is part of the ConfigMgr
2007 Toolkit. The log viewer formats log entries, provides search and
highlighting features, and provides error lookup. You can optionally
turn on an auto-refresh feature to update the displayed log in near real
time.
The smsprov.log file shows
calls to the SMS provider from management applications. The bottom pane
of the log viewer displays the details of the highlighted log entry.
The entry in Figure 1
shows that the user SCCMUNLEASHED\administrator modified an instance of
class SMS_SCI_SiteDefinition. The SMS_SCI_SiteDefinition, displayed in Figure 2, provides an interface to binary data stored in the SiteControl table.
Figure 1 shows a portion of the smsprov.log file as displayed in the log viewer.
The smsprov.log file later shows the following actions performed that commit the changes to the database:
ExecMethodAsync : SMS_SiteControlFile::CommitSCF
CSspClassManager::PreCallAction, dbname=SMS_DAL
CExtProviderClassObject::DoExecuteMethod CommitSCF
Calling SubmitDeltaSCFToDatabase for user=SCCMUNLEASHED\administrator,
computer=WILDFLOWER,component=Microsoft.ConfigurationManagement.dll
CSspSiteControl::CommitSCF - Delta was created
The log file provides additional details of the security context setup and database connection, not displayed here.
Using the SQL Server
Profiler lets you see SQL requests sent to the SQL Server database. (For
information about the SQL Server Profiler, see http://msdn.microsoft.com/en-us/library/ms187929.aspx.)
The following SQL
commands sent by ConfigMgr components show the SMS provider inserting
data into the SiteControl table and the Database Monitor retrieving the
change notification from the database:
[SMS Provider] insert SiteControl (SiteCode, TypeFlag, SerialNumber, BinaryData)
values ("DAL", 2, 33, 0x0)
[SMS_DATABASE_NOTIFICATION_MONITOR] exec spGetChangeNotifications
What connects these two events is a trigger on the SiteControl table. A trigger
is a special SQL procedure that fires in response to specified
data-modification events. The SiteControl table defines the following
trigger:
CREATE TRIGGER [dbo].[SMSDBMON_SiteControl_SiteControl_AddUpd_HMAN_ins]
ON [dbo].[SiteControl] FOR insert AS
BEGIN
INSERT INTO
TableChangeNotifications(Component,TableName,ActionType,Key1,Key2,Key3)
SELECT "SiteControl_AddUpd_HMAN","SiteControl",1,
IsNULL(convert(varchar(256),SiteCode),''),
IsNULL(convert(varchar(256),TypeFlag),''),''
FROM inserted
IF @@ERROR != 0 ROLLBACK TRAN
END
This trigger creates an
entry in the TableChangeNotifications table each time a record is
inserted in the SiteControl table. When the Database Monitor executes
the spGetChangeNotifications stored procedure, it reads the
TableChangeNotifications table and processes any new entries it finds.