How can capture the "last logged in user" UserName or User ID from Discovery for CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 10:49 PM
Hello All,
1.How can capture the "last logged in user" UserName or User ID from Discovery for CI. and discovery uses sys_user (user) table to refer and populate match corresponding UserID, and want to capture the discovered login name even it is not in the User table.
2.i have created custom string field on cmdb_ci_computer table, can i use same field for windows server, linux, etc. server table/form to populate value of "last logged in user". OR i need to create separate filed for each table/form. ( and how can i get value of "last logged in user" from discovery to populate in custom field.
currently using London and in london discovery uses patterns. but am bit confuse where and which pattern need to customized.
i have checked below link and might this solution is given and apply for earlier versions of london - discovery.(probe & sensor)
@jwelton , @doug.schulze - any suggestion.
Thanks in advance.
Bharat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 11:36 PM
Hi -
For question 1, you can create a pattern to retrieve this info (assuming you know the command or location on the target to get the user data from). You'll need a pattern for Windows hosts, another for linux, etc. since they operate differently, but the main process is the same. On the classifications of various OS's, your custom patterns launched (triggered) to go get the data and store it in your custom field on cmdb_ci_computer. For each OS, you'll need to know exactly how & where to get these desired user data. Then your custom patterns can leverage that to retrieve it and store into CIs
For question 2, if you've created field on cmdb_ci_computer class, then its inherited automatically by subclasses, like windows, linux, etc. No need to re-create same field on those extended tables.
Hope this helps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2019 08:01 AM
Thanks Dave for reply.
i am looking for OOTB pattern (Windows OS - Desktop). i can see here in step 7.3 we are setting value to assigned to field of a last logged person id(matching record from sys_user table) and what if i create custom string filed, 'last_logged_user' and set value from the discovery (login ID, User ID, etc.) to custom filed not matching with sys_user table for matching record.
could you help/direct me how can i achieve it with existing pattern.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2019 08:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 08:57 AM