- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎07-05-2021 04:59 AM
Extending Patterns
Goal
In this lab you will learn two general methods of extending discovery using patterns. Requirement is to add the start date field to the Windows Server record that is not captured out of box.
Extending patterns
- 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'

- Select 'New' in the pattern extension section

- Use 'Uptime' as the name, select done

- Click the name Uptime in the extension section to enter the pattern designer

- Click 'Debug'

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

- Set up the pattern step
- Enter a name for the pattern step 'Run Systeminfo Command'
- Set 'Operation' to 'Parse Command Output
- Set Command Details to "systeminfo" (quotes required)
- Click Run Command

- Filter out lines by chosing 'Include Lines' enter System Boot Time:

- Define the Variable strategy
- Set two values 'start_date' and 'start_time'

- Define the delimiters
- A space, " "
- A comma, ","
- Click 'Done'

- Set the positons Remember patterns start at position '1' not '0'
- Enter 4,5

- Add a new step
- top left corner select 'add new step below'

- Select Set Paramater Value

- Set the variables. Easy as dragging the names to the fields
- Drag 'start_date' temporary variable to the value field
- Add a space value by doing start_date+ " "+
- Drag 'start_time' temporary varable to the value field
- Drag 'start_date' computer attribute to the name field

- Click Test

- See result Return

- Save the pattern

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

- See Valid start date on the Windows Server Record

- 4,015 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Naveen,
This is very helpful. Thank you very much.
But don't you think you should change the start_time format as well since by default we get 12Hr format and it can be ambiguous?
Thanks,
Ragini
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @naveen_kumarhr,
thanks for sharing! I saw this requirement a lot and it's good to find the solution now in the community.
I have one little improvement to share with you. To make the Pattern more scalable and secure for future versions I recommend to replace the "Delimited Text" with a RegEx. This one should be scalable and save at a time:
Boot Time:\W*([\d\W]*)[\,][\W]*([\d\W]*)
Let me know what you think.
Thanks again for sharing - Regards,
Manuel
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
would you kindly share how to extend the printer pattern? We are trying to discover some Datamax label printers.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Printer discovery uses probes and sensors not patterns as my lab above shows. So you would have to do that work there.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@doug_schulze thank you, do you have a lab or refernce that I can follow? Thanks