naveen_kumarhr
ServiceNow Employee
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-05-2021 05:06 AM
Extending Patterns Method #2
- in the application Search bar type 'Discovery Patterns' then select the discovery patterns module under pattern designer application

- Search then select for the pattern named 'Windows OS - Servers'

- Here we want to "comment out" our first method so click the Uptime Extension

- Check the pre-condition box
- Set value of 1 contains 2
- Save the pattern

- Go back to the pattern entry

- Create a new Extension Section
- Name it Uptime2

- Click 'Debug'

- Choose your windows midserver and enter the IP of YOUR Midserver, select 'Connect'

- Set initial information
- Name the pattern Step
- Choose WMI Query Operation

- Set the Name Space query
- Namespace = "\root\CIMV2"
- Get Full Statement = "SELECT SystemUpTime FROM Win32_PerfFormattedData_PerfOS_System"
- Target Table = $wmi_uptime

- Test the query

- Validate return, note the value is in seconds

- Add a 'new step below' on the pattern designer

- Edit the step
- Rename the step to 'Set Start Date
- Choose Set Parameter Value

- Set the Values, consider using auto complete
- Value = $wmi_uptime[1].SystemUpTime
- Name = $cmdb_ci_win_server[*].start_date

- Test to validate return

-
Save the pattern, exit out of debug and retun out of the pattern designer
-
In the application search bar type pre post processing
- Select pre post processing module
- Select the 'Fix Start Date on Windows server' record

- Since our WMI return comes back in seconds we need to convert it to an actual time date field by using a glide query. This script does that for us in Pre-sensor mode (befoe the IRE gets involved).
- Check the active box and save the record.

- Run a discovery against your Midserver as you have done in previous steps

- After the discovery completes see the new value

Labels:
- 1,869 Views