Sohail Khilji
Kilo Patron
Kilo Patron

3 Steps [ How to discover Linux Servers in ServiceNow ]

 

SohailKhilji_8-1707633277892.jpeg

 

Lets see how can you get started with your first linux servers discovery using servicenow discovery tool. We will start by understading what is required as part of requirement gathering for linux servers. Below i have attached the pre-req for linux discovery:

 

Subject Credential Permissions
Account A regular user account with following specifications:
– Password set to never expire and not ask for change at first login.
– Write access to the home directory.
– Sudo rights on below commands (with NOPASSWD option in /etc/sudoers file)
dmidecode, lsof, fdisk, dmsetup, multipath
– Read permission on below files is required –
/etc/*release, /etc/bashrc, /etc/profile, /proc/cpuinfo,
/proc/vmware/sched/ncpus, /var/log/dmesg
/etc/sudoers line example
ALL=(root) NOPASSWD:/sbin/dmidecode
ALL=(root) NOPASSWD:/sbin/lsof
Ports TCP22
UDP 53
ICMP ping
Shell bash/sh only

 

REQUIREMENTS:

IP / Subnet : Gather list of all IPs or Subnets which needs to be discovered.

Ports to be opened : 22, 53

User account : SSH or SSH Private Key (Recommended).

Applications/Services : Midserver with good configuration.

 

Once you have all the requirements handy with you, you are good to start creating discovery configuration. Follow the below steps to see if we are good to start servicenow configuration. 

 

Check#1:

Before we get sarted,

Open your midserver and Ping the target IP > 

Eg: ping 127.0.0.1

See if the host if rechable from midserver (This means your able to reach from mid server to target machien)

 

Check#2:

Enter the command to see if your able to connect to the target using 22 port.

Eg: telnet 127.0.0.1 22

(Your target must be connected).

If any error, Reach out the firewall/network team to see if the port is enabled...

 

Check#3:

List of supported servicenow Linux flavours for discovery :

For IPv4 discovery:
Red Hat
Fedora
Debian
SUSE
CentOS
Ubuntu


For IPv6 discovery:
CentOS 7
Ubuntu 20
IPv6 supportability limitations


The following operating systems or devices haven’t been verified for IPv6 discovery:
Red Hat cluster
Oracle Clusterware
Linux Pacemaker cluster
Network storage

 

Check#4:

Open the configured creds record in servicenow (SSH or SSH Private Key) and click on test credentials realted links to see if the creds works for the give IP. (Enter host IP, Port : 22 , Mid server : ( Select the mid server which has ports enabled)

SohailKhilji_0-1707632660016.png

 

 < Lets gets Started >

Step1:

Navigate to : Discovery > Discovery Schedules > new 

SohailKhilji_4-1707632749804.png

SohailKhilji_6-1707632806414.png

 

(Set the below field values, This may vary in your case sometimes...)

 

a. Enter the name of Schedule as needed.

b. Discover : Configuration Item

c. Mid server selection method : Specific mid server (based on need)

d. MID server : choose your mid sever

e. Location : Choose the location of site

f. Set the schedule data and time as needed (Weekly, Monthly, OnDemand etc...)

g. If you want to choose a specific creds for this schedule you can update the Credential alias (Even if left empty servicenow will pick the creds for ssh configured for the selected mid server)

h. Use SNMP version : (Based on type choose v1/v2c or v3).

i. Leave rest of the field untouched. (unless necessary)

SohailKhilji_5-1707632776902.png

 

Save the form...

 

Step2:

Now you must be able to see the realted link > Quick Ranges. Click on it..

 

A pop up box opens asking for IP/Subnets. Enter the IP Subnets, IP address only in a comma seprated list (Eg. 127.0.0.1, 192.168.0.1, etc...)

SohailKhilji_1-1707632696460.png

Click on Make Ranges Button, This will create a 'Discovery IP Range' in the related list.

Now you have defined the IPs for discovery.

 

Step3:

Now, your good to launch your linux discovery... 

Click on 'Discovery Now' related link, This will redirect to the schedule which will discovery the CI... {Eg. DIS0053463}, Open this record which will have all info and progress of your discovery.

 

SohailKhilji_7-1707632846548.png

 

Wait for the state to be 'Completed'...

 

Once the State is set to 'Completed', You are all done ! You may see all the devices discovered in the 'Devices' Realted list. You can observe the 'Ecc Queue' and 'Discovery Log' if there are any error in your discovery.

 

I hope this helped you discover all linux server or has given knowledege on how to discover linux server in servicneow. If yes Mark this article and thumbs up and Bookmark for furture reference....

 

FEEL FREE TO COMMENT BELOW THE ERRORS FACED DURING YOUR DISCOVERY, WILL RESPOND ASAP... 

 

 

<Previous Post                                                             Next Post >

 

           <<<  Top Articles  >>>

  1. ServiceNow Integration with Splunk
  2. LDAP Integration with ServiceNow
  3. ServiceNow Integration with Veeam
  4. Handling ServiceNow flow errors with a flow
  5. Show parent child incident relationships - display in field message
  6. ServiceNow SSO Logout Error (redirects to logout page) – Reason, Fixes and Cause.
  7. Multi Row Variable set ServiceNow MRVS - Creating - Scripting - Example - Limits
  8. ServiceNow Integration with MAC vendor - Get Mac vendor for the given MAC Address.
  9. How to find Log4j vulnerable severs in ServiceNow Using CMDB Query Builder (SecOps) 
  10. How to Cancel a Long-Running Transaction ServiceNow
  11. Hidden Features for System Administrators
  12. Servicenow RPA - Understanding Attended / Unattended / Skilled Automation Bots
  13. How to Perform Servicenow vCenter Discovery | Discovering VMware using vCenter Discovery 
  14. Set Discovery Schedule name to CMDB Record (via Discovery) 

 

MF Sohail Khilji | Servicenow Developer /  Consultant.

LinkedIn >   https://www.linkedin.com/in/mf-sohail-khilji/

 

 

Comments
SaileeV
Tera Contributor

Tried running a discovery for linux machines. Discovery gets completed but it shows credential less. I have configured the credentials and also authenticated them.

 

SaileeV_1-1718354453629.png

 

 

 

SaileeV_0-1718354409959.png

 

Sohail Khilji
Kilo Patron
Kilo Patron

disable the property for credsless. hence it would not try for credentialess

SaileeV
Tera Contributor

Hi Sohail,

 

Had tried by disabling credentialless property. It was still discovering by credentialless approach.

shubhamkhai
Tera Contributor

Thanks @Sohail Khilji 
Really helpful 🤝

Version history
Last update:
‎02-10-2024 10:41 PM
Updated by:
Contributors