The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Troubleshooting Serial Number Discovery for Linux Servers on AWS Using ServiceNow Discovery (ACC)

SK Chand Basha
Tera Sage

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

  1. Edit the Sudoers File for the ServiceNow User

     

    sudo visudo -f /etc/sudoers.d/servicenow
  2. Add the Following Entry:

    servicenow ALL=(ALL) NOPASSWD: /usr/sbin/dmidecode, /usr/sbin/ss
  3. Save and Exit:

    • After typing the command, press Ctrl + X, then Y, then Enter to save and exit.

  4. Verify Access:

    Switch to the ServiceNow user:

    sudo su - servicenow

     

    Expected Result : Empty value
  5. Run:

    sudo /usr/sbin/dmidecode

    You should now see the serial number displayed.

  6. 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!!



1 REPLY 1

AJ-TechTrek
Giga Sage
Giga Sage

Thanks for sharing @SK Chand Basha 

 

Thanks

AJ- TechTrek with AJ