Client Management Suite

 View Only

AltirisAgent 7.0 WMI Provider and Classes 

Apr 30, 2009 05:28 PM

The 7.0 version of the Altiris Agent for Windows includes a WMI provider that is active when the agent is installed on a Windows client. The WMI provider creates several WMI classes in the root\cimv2 namespace. A description and sample return data for these classes follows. Of course, these classes are available for use by a WMI custom inventory task in NS7.

Using a tool such as Scriptomatic2, a free utility available from Microsoft, we can see that Altiris creates the following seven WMI classes:

  1. AltirisAgent_Agents
  2. AltirisAgent_Client
  3. AltirisAgent_LogPage
  4. AltirisAgent_LogRecord
  5. AltirisAgent_Package
  6. AltirisAgent_Stream
  7. AltirisAgent_Task
imagebrowser image

WMI Provider

Symantec has included a WMI Provider in the NS7 Altiris Agent. This provider is, by default, found in the "C:\Program Files\Altiris\Altiris Agent\Agents\WMIProviderAgent" directory. As expected, a MOF file is included that defines the layout of theWMI classes. The MOF file provides details of each WMI class including data types of each attribute. Note that none of these WMI classes accept or allow for 'Puts' except for the altirisagent_client class. We do NOT recommend updating this under any circumstance.

The Altiris WMI Classes

Following is a detailed review of each Altiris WMI class and associated output from a typical client computer, where available. (Note that even though some values are listed as text strings, they are often numeric values in the WMI class. Translation to the string value is not always available.)

AltirisAgent_Agents

Available Attributes:
  • Name
  • Path
  • Version
Sample output: This was blank on my test client.

AltirisAgent_Client

Available Attributes: MachineGUID
Name
Description
Server
InstallDir
Version
LastPolicyUpdate
LastInventoryUpdate
Status (Note: Status returns a numeric value. The string values are: "Unknown", "Stopped", "Start pending", "Stop pending", "Running", "Pause pending" and "Paused". The numeric to string association is currently not listed.)
Sample output: Description: Altiris Agent Client Service
InstallDir: C:\Program Files\Altiris\Altiris Agent
LastInventoryUpdate: 2009-04-22 10:50:26
LastPolicyUpdate: 2009-04-11 02:17:09
MachineGUID: {A91612E9-E6B8-4809-A496-DB37FF05BBBB}
Name: Altiris Agent
Server: djens6.dougj.local
Status: 4
Version: 7.0.3350

AltirisAgent_LogPage

Available Attributes: Page
FileName
FileSize
Modified
Records
Sample output: This was blank on the test client.

AltirisAgent_LogRecord

Available Attributes: Page
Record
Severity
HostName
Source
Module
Process
PID
Thread
TickCount
Message
Date
Sample output: This was blank on the test client.

AltirisAgent_Package

Available Attributes: PackageId
Name
Description
Version
Originator
Destination
CacheFolder
PackageSize
ContainsFiles (Values: "No", "Yes")
Tasks (List of tasks using this package)
CleanupAfter (-1=Never, 0=Immediately, 1=1 day,2=2 days, etc.)
IsActive (Values: Yes, No)
IsRemoved (Values: Yes, No)
PostStatusEvents (Values: Yes, No)
Status (Values: Invalid, Ready, Downloading, Pending, Retrying, Download required)
Sample output:

Data similar to the following repeated for each package on a client computer:

CacheFolder: C:\Program Files\Altiris\Altiris Agent\Software Delivery\{01B54EB5-3679-4C73-9E10-E169D5A5EC59}\cache CleanupAfter: 10080
ContainsFiles: 1
Description: Inventory Agent Package
Destination:
IsActive: 1
IsRemoved: 0
Name: Inventory Agent Package
Originator: NSInternal
PackageId: {01B54EB5-3679-4C73-9E10-E169D5A5EC59}
PackageSize: 5985777
PostStatusEvents: 1
Status: 1
Tasks: Recreate Full Inventory,Hardware Inventory
Version: 6.1

AltirisAgent_Stream

Available Attributes: StreamID
StartPos
Length
Data
Sample output: This was blank on the test client.

AltirisAgent_Task

Available Attributes: TaskId
Name
Description
Priority (Values "100","50","0","-50" equate to "Very High", "High", "Normal", "Low")
IsActive (Values: Yes, No)
IsRemoved (Values: Yes, No)
IsScheduled (Values: Yes, No)
Schedule (Format is XML)
AvailableTime (format is time)
ExpiryTime;
NextRunTime;
NotifyBeforeRun (Values: Yes, No)
NotifyUserArrival (Values: Yes, No)
RetryAsap (Values: Yes, No)
RunAsap (Values: Yes, No)
RunAtLogon (Values: Yes, No)
RunAtStartup (Values: Yes, No)
PostStatusEvents (Values: Yes, No)
UserEnabled (Values: Yes, No)
UserMayRun (Values: Yes, No)
UserOptional (Values: Yes, No)
CommandLine;
ExecutionContext (Values: "Interactive user", "Administrator", "System account", "Specified user")
Interactive; (Values: Yes, No)
UserRequired (Values: Yes, No)
RunAsUser;
Status (Values: "OK", "Never run", "Failed", "Start failed", "Run completed", "Terminated", "Queued", "Can not run", "Running")
EstimatedRunTime;
EstimatedDiskSpace;
PostRunAction (Values: "Do nothing", "Restart", "Log off", "Force restart")
Package (Name of the package for this task)
Policy (Name of the policy for this task)
Sample output: Note: Data similar to the following is repeated for each task on a client computer.

AvailableTime: 2000-01-01 00:00:00
CommandLine: AeXInvSoln.exe /cleanbeforerun /hidden /s AeXInvSolnAdm3.ini
Description: Runs software audit, serial number, and machine inventory on a monthly schedule and sends all inventory data to the NS regardless of whether the inventory has changed since last run.
EstimatedDiskSpace: 3000
EstimatedRunTime: 2
ExecutionContext: 0
ExpiryTime:
Interactive: 0
IsActive: 1
IsRemoved: 0
IsScheduled: 1
Name: Recreate Full Inventory
NextRunTime: 2009-05-01 01:15:00
NotifyBeforeRun: 0
NotifyUserArrival: 0
Package: Inventory Agent Package
Policy: Recreate Full Inventory
PostRunAction: 0
PostStatusEvents: 1
Priority: 0
RetryAsap: 1
RunAsap: 1
RunAsUser:
RunAtLogon: 0
RunAtStartup: 0
Schedule: <Task>
<Trigger Type="3" Duration="0" Interval="0" KillAtEnd="0" Disabled="0" Description="At 1:15 AM on day 1 of every month starting Tuesday, May 22, 2001">
<BeginDate>2001-05-22 01:15:00</BeginDate>
<DaysOfMonth>1</DaysOfMonth>
<MonthsOfYear>4095</MonthsOfYear>
</Trigger>
</Task>
Status: 2
TaskId: {5BC50719-3FFB-4C1A-B55A-705731C8E268}
UserEnabled: 1
UserMayRun: 1
UserOptional: 0
UserRequired: 1

Custom Inventory to Return Altiris WMI Information

Following is a sample setup procedure to query the Altirisagent_Package WMI class to return a list of all packages on the client and some related information from this wmi class.

Create a Custom Data Class

In the Symantec Management Console:

  1. Browse to the Settings tab, then Settings, Discovery and Inventory, Inventory Solution and click on Manage Custom Data classes.
  2. Create a new data class by clicking the 'New data class' button.
  3. Enter an appropriate name, i.e., 'AltirisAgent Package', and a description.
  4. Allow the screen to refresh.
  5. Click on the name of the new data class in the 'Data class' list.
  6. Create the attributes (or columns) for this data class by clicking on the '+ Add attribute' button.
  7. Enter an appropriate name, i.e., 'PackageID', and select the desired Data type, Maximum size, Key and Data required values, as shown in the following image.
  8. Create custom data class attributes for the following WMI attributes. Be sure to allow appropriate data sizes.

    a. PackageId
    b. Name
    c. CacheFolder
    d. PackageSize
    e. ContainsFiles
    f. Tasks
    g. CleanupAfter
    h. Status

  9. Check the 'Allow multiple rows from a single computer resource' checkbox since there will likely be multiple packages on each client.
  10. Click the 'Save changes' button. The data class and corresponding table will be created.
  11. The following image shows a completed custom data class for this project.
imagebrowser image

Create a VBScript to use in the Custom Inventory Task

A VBScript that uses the class and methods found in the AltirisAeXNSEvent.dll file, can be ran outside of the NS console. It is helpful to debug the script by running it from a command line or another preferred method. As long as the client computer has the Inventory Agent Plug-in installed, this dll should be registered on the client and the associated class and methods should work from anywhere on that client machine.

  1. Copy the attached VBScript file to a text editor on a computer that has the Inventory Agent Plug-in installed.
  2. Save the script to a preferred directory of your choice. It needs to have a '.vbs' file extension.
  3. Open a DOS command shell.
  4. CD to the preferred directory containing this script.
  5. Run 'cscript <scriptname>.vbs'.
  6. Note the presence or absence of any on-screen errors and perform any necessary debugging.
  7. If no errors occurred, open SQL Server Management Studio, open a SQL Query window and query the new table, e.g., 'select * from inv_altiris_agent_packages2'. You should see results from the client machine listed.
  8. If necessary, check the logviewer for any related errors, e.g., dataloading, mismatched data class name, mismatched data types, etc., and make any necessary corrections to the VBScript.
  9. Once the script is complete and data processes accurately, the text of the script is ready to be pasted into an NS task, which is described in the next section.

Note: Due to the nature of the data in the 'Tasks' attribute, it is necessary to join the individual, comma-delimited entries in that attribute into a new variable and load the new variable data into the objDataRow object. It may also be necessary to convert certain data values to string even if they were defined in the Custom Data Class as other than string. Examples of both are shown below.

objDataRow.SetField 3, CStr(objInfo.PackageSize)
strTasks = Join(objInfo.Tasks, ",")
objDataRow.SetField 5, strTasks

Create a Custom Inventory Task

To create the actual task to run on client computers:

  1. Open the Symantec Management Console in a browser
  2. Browse to the 'Manage' menu item
  3. Click on 'Jobs and Tasks', which is the top menu tree item in the left-hand screen.
  4. In the 'Jobs and Tasks Quick Start' web part, click on 'Create a new job or task'. A new window will open.
  5. Scroll to the very bottom of the menu tree to find the correct 'Run Script' menu tree entry. In this image, all menu tree folders have been collapsed to show the menu tree hierarchy. The correct menu tree entry is highlighted.
  6. Enter a name for the task or job in the top line (above 'Script Details').
  7. Select 'VBScript' from the 'Script Type' drop-down list.
  8. Paste the vbscript code from the previous section into the Script details window, as shown below. imagebrowser image
  9. Click 'OK' to save the task.
  10. Note that once saved, the task will appear in the menu under 'Jobs and Tasks', 'System Jobs and Tasks', 'Notification Server'.
  11. Highlight the task. Note that it is still editable from this screen. imagebrowser image
  12. Run the new task as a 'Quick Run' task or create a schedule for it.
  13. Query the results directly from the database or create a new report to show the data.

Much more information is now available to an Altiris Admin due to the inclusion of the Altiris Agent WMI provider. An admin can quickly determine much more about Windows client computers in their environment via custom inventory quick run or scheduled tasks.

Possible reports include:

  1. What Agent version is installed on a client, what is the installation path and status?
  2. Did a particular client get a policy notification?
  3. Did a client download a package?
  4. Which policies use a particular package?

And much more.

Statistics
0 Favorited
4 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
txt file
altirisagent_packages.vbs_.txt   1 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Mar 26, 2010 03:03 PM

I would like Altiris automatically inventory also, drivers with file & version, and also the P&P enumeration string.

Please, see & vote this Idea:
https://www-secure.symantec.com/connect/idea/integrate-windows-device-enumeration-string-missing-drivers-drivers-file-name-version

Related Entries and Links

No Related Resource entered.