- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2019 12:59 AM
Hi
Can anyone help me with discovery related to exclude CI's based on host name i.e starting with d2,D2 not with IPAddress
I Tried with 2 methods
1) I tried modifying DiscoveryJSONIDSensor and DiscoveryIDSensor script includes by adding the below script at Line89
var regexp = new RegExp('^[dD][2]'); //hostnames ending in p01 or P2 or similar
var host_name = this.ciData.data.host_name;
if (!host_name)
host_name = this.ciData.data.name;
var sub = host_name.substring(0,2);
if (sub=='d2' || sub=='D2'){
this.explore = false;
this.setTriggerProbes(false);
logger.info('Non-prod machine: '+ host_name +'. Not exploring device', this.type, this.getEccQueueId());
return false;
} else {
logger.info('Production Machine: '+ host_name +'. Continue to explore device', this.type, this.getEccQueueId());
}
2) I tried changing Classifier by adding Classification Criteria.
Both the cases did not worked
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
Solved! Go to Solution.
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2019 12:25 AM
Hi Rohila,
Apologies, looks like I have some errors in my notes on this. You could try the following:
hostname instead of host_name with Windows. i.e. hostname does not start with d2:
cidata.host_name does not start with d2:
If you still have a problem, post a screenshot of the classifier and I will have a look.
I would also test this thoroughly before doing deciding to implement this in a production envrionment.
Regards,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2019 07:34 AM
Hi Rohila,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2019 10:41 PM
Hi Dave
I tried the solution you gave which is not working for windows classifers and also all the linux devices are not classifying.
I also tried using regular expressions in classification criteria but it did not worked
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2019 12:25 AM
Hi Rohila,
Apologies, looks like I have some errors in my notes on this. You could try the following:
hostname instead of host_name with Windows. i.e. hostname does not start with d2:
cidata.host_name does not start with d2:
If you still have a problem, post a screenshot of the classifier and I will have a look.
I would also test this thoroughly before doing deciding to implement this in a production envrionment.
Regards,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2019 03:11 AM
Hi Dave,
Thank you for your quick response. Provided solutions are working for linux and windows. Please let us know whether we can implement this on PROD as a best practice note.
I have another requirement as well on the same issue. We are blocking linux and windows of traditional discovery using classification criteria. How we can block the same if we are getting information from VCenter servers(VM Instances).
Shall i create a new thread for the same or can you help me out regarding this as well, which adds lot of help for us.
Regards,
Rohila
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP