Troubleshooting Serial Number Discovery for Linux Servers on AWS Using ServiceNow Discovery (ACC)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 12:49 AM
While working on a ServiceNow Discovery for a Linux server hosted on AWS, I faced an issue where the serial number was not being captured, even though all discovery steps appeared to be successful.
Configured a sudo user (servicenow) on the Linux server.
Added the following entry to the /etc/sudoers file:
servicenow ALL=(ALL) NOPASSWD:ALL
Configured these credentials on the MID Server.
Ran Quick Discovery, which completed — but the serial number was missing from the CI record.
When I manually ran the following command on the server:
sudo /usr/sbin/dmidecode
It returned the serial number correctly, confirming that the OS supported it and the permissions were in place.
Solution
The issue was due to restricted execution of specific commands when initiated via ServiceNow Discovery/ACC, even if the user had general sudo access.
To fix this, the servicenow user needs to be granted explicit permission to run the required discovery commands without a password.
Step-by-Step Fix
Edit the Sudoers File for the ServiceNow User
sudo visudo -f /etc/sudoers.d/servicenow
Add the Following Entry:
servicenow ALL=(ALL) NOPASSWD: /usr/sbin/dmidecode, /usr/sbin/ss
Save and Exit:
After typing the command, press Ctrl + X, then Y, then Enter to save and exit.
Verify Access:
Switch to the ServiceNow user:
sudo su - servicenow
Run:
sudo /usr/sbin/dmidecode
You should now see the serial number displayed.
Restart the MID Server and ACC Service:
List services:
systemctl list-unit-files --type service -all
Restart the necessary services:
sudo systemctl restart <service_name>
After applying this fix and restarting the MID Server, the serial number was successfully discovered via ACC in ServiceNow.
Mark it helpful if this helps you to understand!!
- 366 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2025 07:40 AM