Use the following procedure to create a probe-based (script) performance collection rule in Essentials 2007. Probe-based rules can get data from an unlimited number of sources, such as the file system or operating system properties. Probe-based rules should not change the state of an object. The data collected by the rule will display in performance views for the targeted objects.
To create a probe-based performance collection rule
-
Start the Essentials 2007 Create Rule Wizard.
Примечание For information about starting the Create Rule Wizard, see Запуск мастера создания правила в System Center Essentials. -
On the Select a Rule Type page, do the following:
- Expand Collection Rules, expand Probe Based, and
then click Script (Performance).
- Select a Management pack from the list, such as
Default Management Pack, or click New to create a
Management Pack with the Create a Management Pack Wizard.
Примечание The rule will be added to the specified Management Pack; therefore, only unsealed Management Packs are listed. - Click Next.
- Expand Collection Rules, expand Probe Based, and
then click Script (Performance).
-
On the Rule Name and Description page, do the following:
- Type the Rule name, such as NumProc.
- Click Select, select a target, such as Windows
Computer, and then click OK.
- Leave Rule is enabled selected to have the rule take
affect at the completion of the wizard, or clear the check box to
enable the rule at a later time, and then click Next.
- Type the Rule name, such as NumProc.
-
On the Schedule page, specify how often the rule will run, and then Select Synchronize at to set the time the rule will start. For example, set the rule to run every 1 hour starting at 12:15 AM. Rules set to run on a daily interval are scheduled to start at 12:00AM.
-
On the Script page, do the following:
- Type the Name and extension of the script, such as
NumProc.vbs.
- Set Timeout to the length of time in seconds, minutes,
hours, or days, the script can run before it is terminated.
- Type the Script, for example:
Set oAPI = CreateObject("MOM.ScriptAPI")
set bag= oAPI.CreatePropertyBag()
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
call bag.AddValue("Number of Processors", WshSysEnv("NUMBER_OF_PROCESSORS"))
call oAPI.Return(bag)
Примечание The preceding example will determine the number of processors a computer has. - Click Next.
- Type the Name and extension of the script, such as
NumProc.vbs.
-
On the Performance Mapper page, map parameters from the script to fields in the event, for example:
Важно Parameters are case sensitive. - In Object, type Processor.
- In Counter, type Number_of_Processors.
- In Instances, type All Instances.
- Click the Value (…) button.
- In the Value dialog box, click Data, and then
click Property.
- In Value, replace [PropertyName] with Number
of Processors. The path should read,
$Data/Property[@Name='Number of Processors']$.
- Click OK, and then click Create.
- In Object, type Processor.