Introduction to Custom Inventory in Notification Server 7.0

Machine Translations

Notification Server 7.0 introduces major enhancements and changes to the custom inventory process. This article provides a preview of the process, as of the date of this article.

NOTE: The purpose of this article is to give a sneak peak. UI elements, help or label text, may be changed in the interim between now and the release. This article provides no guarantees or promises and what will be delivered in the final release.

Introduction

Custom Inventory in Notification Server 7.0 is cross-platform and script-based. In NS7, the same console screens are used to create and configure custom inventory across all platforms - Windows, Unix, Linux and Macintosh. Depending on the platform and installed components, scripts can be written in any of the following scripting languages:

Applescript

Command script

JavaScript

Perl

PowerShell

Python

Unix Shell script

VBScript

Prior to NS7, the custom inventory dataclass and table could be created by the first incoming custom inventory NSE containing the schema and data for a given dataclass. Now, in NS7, custom Inventory requires that the data class be created on the Notification Server prior to deploying the custom inventory task to clients. These data classes are referred to as 'custom data classes'.

The basic process of creating a custom inventory task is:

Create the data class in the NS console

Create the task with scripting logic in the Notification Server console.

Create a report to view the results of custom inventory. (This document will not discuss report creation.)

Note: Custom Inventory source xml/cit files from Inventory for Windows 6.x can still be used in Inventory for Windows 7.0. This will be documented and previewed in a separate article.

Note: The syntax for Unix shell scripts in 7.0 is identical to the syntax in 6.x, with the addition of an inclusion of a helper shell script.

Further documentation is available by browsing on an NS7 server to <installdrive>:\Program Files\Altiris\Documentation\Web\en\Inventory\help\index.html. The documentation now features a very nice search utility. Searching for 'custom inventory' will return several related pages.

Click on '* New Dataclass' and enter a Name and Description. In this example, I will be selecting data from the Win32_UserAccount class and creating attributes for the following three fields: Name, Disabled and SID.

Note the option to 'Allow multiple rows from a single computer resource'. This is helpful, and necessary, as is the case with a User report, for example, where multiple users can be reported on each computer.

When you are done adding attributes, click 'Save changes' at the bottom of the screen.

8. The GUID for this dataclass will be required to be entered in the script. To find the guid, click on a dataclass name, then click the 'Details' button, which is the little hand between the 'New dataclass' button and the red 'X' button. Make a note of the guid value and save it for later use. (Note: this is a Windows-only requirement. Unix, Linux and Macintosh scripting do not have this requirement.)

Create a Custom Task and Script for Windows

The easiest way to create a new custom inventory task is to clone a sample. The sample already contains the required code for a WMI query. You will only need to add your own logic to gather the data you require and to populate the attribute variables in the script.

For this example, we will walk through the steps required to create a new task and manually enter the custom inventory code. This code can be copied from a sample, or previously existing, custom inventory task prior to creating this new task.

In the NS7 Console, click on 'Manage' > 'Jobs and Tasks' and click on the 'Jobs and Tasks' menu entry in the left-hand pane.

The 'Task Status' section of this screen contains scheduling and other options. Scheduling is partly controlled by core NS functionality and partly by Inventory Solution functionality.

Quick Run - When this option is selected, a combo list box is presented. The desired client computer name can be entered. Also, a drop-down list of available resources will be populated and the desired resource can be chosen from the list. Selecting a resource and clicking 'run' will initiate the task on the selected client immediately, depending on maintenance windows, etc.

New Schedule - This is a standard scheduling window. A new schedule will be associated with the current task, allow for selection of specific resources, and can be ran 'Now' or on a specified schedule that has the option to repeat at a specified frequency. There is also an option to override maintenance windows.

Other features in the 'Task Status' section are the task details screen, delete task entries, task history view, grouping and search options and the refresh button.

Details - This is the little hand icon. It shows details of when the highlighted task ran, if it succeeded, etc.

Delete - The red 'X' allows you to delete highlighted entries in the task status section.

View - Allows for seeing current or archived entries.

Group By - Provides a drop-down list for grouping entries to see a higher-level view.

Create a Custom Task and Script for Unix, Linux or Macintosh

Creating a Unix or Linux custom inventory task is exactly the same as creating a custom inventory task for Windows except for the scripting language and the actual code, or logic, used in the script. The Unix and Linux custom inventory in NS7 was built to facilitate the re-use of custom inventory logic from an NS6 environment.

Follow the same steps for creating a new task or simply browse to Jobs and Tasks -> Samples -> Custom ->Custom Inventory - PS List

Right-click on the above task and select clone.

Modify the code as required for your specific requirements.

After saving the task, it may be helpful to move it to a more appropriate folder in the menu tree. Simply open the desired location in the menu tree and drag the task to that location.

The task can be ran and scheduled the same as for any other task in the NS console.

Following is a sample of the shell script code required for a Unix or Linux custom inventory.

The aexnsevent.dll file must exist and be properly registered on the client in order for custom inventory 7.x to work. This dll is installed as part of the agent/solution installation. Without it, the vbscript will fail as it wont be able to create the nse-related objects and use the object's methods, etc. Also, if the agent isn't installed, no data will be sent to the NS.

cscript/wscript already exist on windows machines, so the ability to kick off a vbscript already exists on windows machines.