foreign [Music] s on the servicenow platform and crawls a company's Network finding hardware and software to create an accurate and up-to-date model of their it infrastructure in this video I cover the fundamentals of servicenow Discovery including what it does and how it works and how you can figure things like mid servers and permissions and schedules and we'll do a live servicenow Discovery to see the four phases of Discovery and how it uses probes and patterns everything you need to know to pass servicenow CSA examination or just level up your servicenow Discovery skills my name is
Jeff tease and I've been a software developer and Technical architect for over 30 years working with all sorts of different languages and platforms and databases and most recently I've been spending all of my time in servicenow I believe that learning about it and software development should be fun and that we tend to over complicate things and that's why I created the YouTube channel servicenow simple if you're new go to the channel I would love it if you'd consider subscribing and now let's jump into it servicenow Discovery fundamentals Discovery is an app that runs on the
servicenow platform allowing a company to automatically scan their Network identify all the hardware and software they have running and populate the configuration management databaser cmdb we discussed the cmdb in my last video which if you haven't watched it you should because it's awesome the cmdb is a set of database tables in the servicenow database that provides a logical service-based model of your company's I.T infrastructure here's a picture showing the cmdb and how the data gets loaded and you can see there are primarily three ways you can type it in which is fine for a few
things and making small changes or you can build Integrations and import from your existing inventory systems that's better and servicenow provides a bunch of tools for doing it way best of all though is using an automated Discovery tool like servicenow discovery which is the topic of this video before we get too deep let's cover a few facts first Discovery scans and network and finds devices things like computers or servers and routers pretty much anything that has an IP address and it discovers the software applications running on those devices like databases or virtual machines and web
servers all those discovered devices and software and the relationships between them get stored in this cmdb also the discovery tool is agentless meaning you don't have to install anything on the devices for them to be discovered it's kind of like magic but without the magic which I'll show you in a few minutes Discovery is not included as part of the servicenow based system if a company chooses to use it they'll need to purchase a subscription and download the app from the servicenow store and if they do they'll be diving into one of servicenow's largest application
bundles I'll jump into the UI and show you by entering Discovery in the app nav filter here's the discovery app and you can see lots of modules for things like the discovery home and dashboard managing schedules credentials mid-servers and the eccq and Discovery definition for setting up behaviors and probes and sensors nearly 70 application modules are designed specifically for configuring and managing Discovery it's a lot we can't cover it all here but we'll hit the high points now we know what Discovery is and does let's talk about how it works and have a look at
the high level architecture to start we have our servicenow instance which contains our cmdb and we have our corporate network with our devices and software normally protected by some Enterprise firewall the first thing we need to do is bridge the gap between them and that's done by installing what servicenow calls a management instrumentation and Discovery server or mid-server inside the corporate Network a mid server is actually just a lightweight Java application running as a Windows service or a Unix Daemon on a server inside the company's firewall the purpose of the mid-server is to facilitate communication
and the movement of data between the servicenow instance and the company's Network midsurfers are used for discovery which we're focusing on here but they're also used for other applications like service mapping and integration Hub and building custom Integrations for importing data mid-service communicate with the servicenow instance using https on Port 443 and they communicate across what's called an external Communications Channel or ECC mid servers only make outbound calls to the servicenow instance the instance never calls the midserver the way it works is the mid server establishes a sort of subscription-like connection with the ECC cue
so it's constantly pinging the ECC looking for work placed into the queue by the instance when the instance requests a discovery execution it does so by placing an output record on the ECC the mid server picks it up and executes the discovery scan and Returns the discovered data via input records on the ECC that's a good fundamental picture of how Discovery works one thing I'll add though is that it's possible and normally desirable to have multiple mid servers deployed across the network ideally mid servers are installed in locations near the devices they'll be discovering so
if you have multiple data centers for example installing mid servers in each of those locations to discover devices more locally performs better I'll also mention that although mid-service can be installed on both windows and Linux operating systems installations on Windows servers are preferred the reason for this is that Linux based mids cannot run Windows protocols so they can only discover Linux devices Windows mids on the other hand can discover both windows and Linux devices so let's have a look at these mid servers in the UI navigate to Discovery midservers this displays a list of all
the mid servers currently set up for the instance unfortunately I can't really demonstrate the process for installing a mid server but I can tell you that the service now provides multiple installers for both windows and Linux based installations and I'll provide a link to the documentation in the description of the video you can see from my test instance I have one mid server installed named Windows underscore mid looking at the default attributes we can see the host that the mids installed on the status currently down whether the mid has been validated more on that in
a second the version of the mid software when it was last refreshed started and stopped and more and as always we can see additional attributes and related data by opening the record and accessing the mid-server form view notice here we can see the IP address of the host 198 51 22 147 make a note of that as we'll use it in a bit when we run Discovery against this host device after a mid-server is installed and before it can be used it needs to be validated and that can be done by selecting the mid-service checkbox
and using the actions on selected rows drop down validate option and after a minute or so we can refresh our view and see that the mid server is validated and the status is changed to up this mid server is now ready to use another useful tool related to Mid servers is the mid server dashboard to see that navigate to Mid server dashboard this is a great for monitoring the operation of all the mid servers including reports and gauges that describe the status and issues CPU and memory usage the process of executing a discovery scan Works
through a sequence of four phases called scanning classification identification and exploration we'll look at each of these in detail but at a high level here's how it works Discovery is kicked off for a given range of IP addresses in the scanning phase the IPS are pinged via what are called Port probes or Shazam probes the Shazam probes tell us two things first is there a reachable device at that IP address and if there is which ports on that device are being used for communication this is an important first step is we can learn a lot
about a device based upon which ports are being used for example we know the Windows management instrumentation wmi protocol uses Port 135 if a device is using this port it's a good indication we've located a Windows device upon what was discovered with the port probes in the scanning phase Discovery sends a more specific probe to gather additional details about the device details that are used to classify the device as some specific type of configuration item or CI so we found a Windows device is it a Windows Server what version of Windows is it running that
sort of interrogation leads to the classification once the classification phase is complete the identification and exploration phases can begin the identification phase is responsible for determining if a CI already exists within the cmdb for this device or if one needs to be created you can think back to the identification rules section of my cmdb fundamentals video if you watched it and if you haven't you should because it's awesome and the exploration phase sends additional probes Gathering details about the device like RAM and CPU and hard drive and software every time it executes Discovery passes through
these four phases for the IP addresses included in the Target and the results are sent back and stored in the cmdb okay we're about ready to kick off a discovery demonstration but before we do I want to dig just a little bit deeper into these four phases if you can stick with me for this next couple of minutes you'll really understand how these things work and that there's no magic involved in fact it's all really transparent and customizable first a discovery execution begins with the scanning phase in which Shazam probes are sent out to scan
the IP address for active ports we can see how that's set up by traversing to Discovery definition Port probes this is the list of Port probes that are sent out and we can see there are 16 of them out of box Shazam executes these Port probes in order of classification priority so we can see the one named wmi is first followed by SSH then SNMP and so on to see what's really happening for each of these we can open the record let's open the first one wmi the key things to look at here are the
triggered by service attribute and the trigger probes related list triggered by Services tells Shazam which port to check for this particular probe in this case wmi and we can see from the UI element that there can be multiple entries here this field is a reference to another table in the servicenow database that stores IP Services let's look at it I'll unlock the record picker and we can see we have a single IP service selected named epmap not a very helpful name but from here we can select the entry and click the preview icon to preview
the related record and here's our IP service record note there's the port and there's the protocol so Shazam executes the wmi probe first which includes a single IP service named epmap which specifies investigating Port 135 using TCP if no activity is detected on that Port Shazam grabs the next highest priority Port probe and executes it continuing down the list until the active Port is detected or the device is marked undiscoverable if activity is detected on Port 135 the port scanning phase is complete and we're ready to move to the classification phase at this point with
the scanning phase complete we're pretty sure we've discovered a Windows device but we aren't quite ready yet to make a specific CI classification to do that we need a little more information in this case we need to know a little more about the device's operating system so where to next fortunately our Port probe record tells us down in the trigger probes related list we need to use the windows classify classification probe and from here we can see additional data will be gathered from the device and the classification logic is handled by the windows classify sensor
which uses JavaScript to analyze the data and make a classification decision we're getting into the weeds a bit here but I hope you get the point everything that Discovery is doing as it works through its way through the four phases is entirely transparent it executes according to parameters that can be viewed understood and enhanced to meet your needs the tools are all there that said think twice about making changes servicenow is configured Discovery to work based upon years of experience working with countless companies you might well need to make additions and tweaks just tread lightly
especially from the start and remember we need to crawl before we walk and walk before we run all right enough Chit Chat let's take Discovery for a test drive there are several ways to kick off a discovery scan first and most common is through the creation of a discovery schedule record a discovery schedule record allows you to run Discovery automatically at a specified interval in time you can navigate to Discovery Discovery schedules to see the list of all the scans currently scheduled from here we can click the new button to create a new discovery scan
let's give your schedule a name and we'll do an IP based Discovery most common select a mid server you'd like to use and choose your run increment we'll say daily and we'll leave the time at midnight save the record and now we can specify the IP ranges we want the scan to include there are several ways to do that I'll choose the quick ranges link from the related links section I'll let you all read this for a bit IP addresses can be entered individually as a list or as a range you go ahead and enter
your IPS and click the make ranges button to add them to the schedule it's also possible to execute a quick Discovery and that's what we'll do for our demonstration what I'm going to do is kick off a quick Discovery against the device that is hosting our mid server if you remember I grab the IP address when we were looking at the mid-server record 198 51 222 147. I'll click the quick Discovery button from the discovery schedule list View and I'll enter that IP address as our Target now select the mid server I want to use
and click ok and at this point all of this stuff is happening the UI presents us with a discovery status record which we can use to see how things are progressing we can see for example the state of the discovery execution is active meaning it's currently running and if we open the record we can view lots of details related to our scan the eccq tab shows us all the input and output records that are being shipped back and forth between the instance and the mid server on the ECC Channel the discovery log displays log entries
related to the scan and the devices tab tab will tell us how many devices have been discovered now that our Discovery execution is completed let's reopen the status record and see what happened first we can see that 10 records in total were passed across the ECC five output records from the instance to the mid and five input records from the mid back to the instance and there were also six log entries created if we need to dig more deeply into the details and finally one device was discovered of type Windows server that resulted in a
new CI being created in the cmdb pretty cool and if we want to get more details about the device the cmdbci field provides a link directly to our new cmdb entry notice we have the manufacturer the serial number the model ID the operating system and version and check this out software running on the device configuration files network adapters storage devices and running processes let's wrap up by discussing one of the biggest challenges with implementing Discovery and that is the creation and management of credentials in order for Discovery to scan and gather details it needs credentials
to the Discover device if we navigate to Discovery credentials we can see a list view of credential records that exist for this instance my instance currently only has two notice the credential record named Windows mid server service account this is the credential that enabled us to successfully run quick Discovery against our mid server credentials are stored in a database table named credentials and the credential values are stored within encrypted Fields And once the credentials entered it cannot be viewed during the classification phase of a scan the mid server will request credentials from the instance to
access and gather the details needed for classifying the device the instance will decrypt the credentials and pass them to the mid-server through a series of Highly secure transactions credentials are then attempted against the discovered devices in order of priority if one fails the next one is attempted and as soon as a credential is successful a record called a credential Affinity record gets created linking the device with the credential that way the next time a scan executes and the device is discovered the correct the credential defined in the credential Affinity record gets attempted first credentials can
be created by clicking the new button from the credentials list View and there are many different types of credentials that can be created AWS credentials for example are used for network and print devices in Cloud environments cim credentials for storage devices based upon the common infrastructure model an SNMP used to discover Network and print devices SSH for Unix and Linux devices and wmi for Windows devices and many more and just so you're aware it's also possible possible to store your credentials on an external storage device by using servicenow's external credential storage plugin if that's preferred
if a device is discovered for which no credentials are successful it will be logged with an appropriate missing credentials message and an error will be displayed on the Discovery homepage and at that point further analysis can be done to populate the appropriate credential record and also servicenow Discovery comes with what is called a credential list option if configured credential list Discovery allows the application to attempt some level of classification and identification using a minimal set of attributes in that case more generic Ci's can be created until the credentials are established and the details can be
added if there's one thing we've discovered about Discovery it might be that discovery is a lot there's a lot there but I hope you leave a little more confident than you came and know that there's no magic there and nothing's hidden it's all there for you to explore and look into and learn about I hope you found the video helpful drop us some comments and let me know what your experience has been like with servicenow Discovery or if you have any questions or comments subscribe if you like thanks for watching and I'll see you in
the next one [Music] foreign [Music]