Custom probe/sensor Local Admins on a computer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 01:27 PM
Created a new probe/sensor (available here) to fill the afternoon that pulls back the local administrators configured on a host. You will need to create a new table and in that table a reference field back to computer. As you can see in the sensor I created a table (not extended from anything called Local Administrators and a reference field to cmdb_ci_computer called Configured on. Props to Ryan Zulli for his all star assist
//Note that you should have custom tables that you are inserting the records into and syncing on
this.addToRelatedList('u_local_administrators', adminList, 'u_configured_on', 'name');
Also in the probe you'll see the command that is being run 'net localgroup administrators' well you can easily change that to pull in 'net localgroup "remote desktop users"'
Hope someone can get some good use from it!
And as always, remember sharing is caring..
- Labels:
-
Discovery
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2015 01:53 PM
Doug, it's almost as if you were reading my mind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:42 PM
Doug, I should have reviewed the .xml a bit closer and would have seen it was an update set. Probe, probe parameter and sensor created. I created the table u_local_administrators with a reference field to cmdb_ci_computer called Configured on . I tested the probe and it is not populating that table.
What am I missing?
//Note that you should have custom tables that you are inserting the records into and syncing on
this.addToRelatedList('u_local_administrators', adminList, 'u_configured_on', 'name');
I understand this.addToRelatedList is 'tablename', array name, 'reference name' and key name. I added 'name' as the reference key to configured_on. Was that correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 01:49 PM
I actually forgot to test this out as the functionality was what I was looking for. There's a couple lines wrong in the script on the lines below.
18. adminInfoArray.u_name = lines[i].trim();
28. this.addToRelatedList('u_local_administrators', adminList, 'u_configured_on', 'u_name');
adminInfoArray.u_user and addToRelatedList(blah,blah,blah,name) need to be synced to the same field value. Since SN loves to prefix everything with "u_", u_name fits just perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2015 11:33 AM
Candy,
Double check that you have added the probe to your classifier for the system you are testing (it gets me all the time)