Skip to content

Create Discovery: Automated Device Discovery via Quick Discovery! #1079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

selvarun-umass
Copy link
Contributor

This code snippet automates the discovery of devices in ServiceNow using MID (Management, Instrumentation, and Discovery) servers by triggering Quick Discovery through a workflow. The code can also be modified for different workflows/ flows as needed.

Key features include:

MID Server Setup: It defines two MID servers to ensure redundancy, which improves the chances of successfully finding devices.

IP Address Retrieval: The code retrieves the IP address to be scanned from the current workflow context.

Discovery Process:

It creates a Discovery object to initiate the process. The script first attempts to find the device using the first MID server. If that fails, it logs a message and tries again with the second MID server. Logging and Status Update: After the discovery attempts, the script logs the results and updates the current context with the discovery status.

This code enhances device discovery in ServiceNow, making the process more reliable by utilizing multiple MID servers.

…k Discovery

This code snippet automates the discovery of devices in ServiceNow using MID (Management, Instrumentation, and Discovery) servers by triggering Quick Discovery through a workflow. The code can also be modified for different workflows/ flows as needed.

Key features include:

MID Server Setup: It defines two MID servers to ensure redundancy, which improves the chances of successfully finding devices.

IP Address Retrieval: The code retrieves the IP address to be scanned from the current workflow context.

Discovery Process:

It creates a Discovery object to initiate the process.
The script first attempts to find the device using the first MID server. If that fails, it logs a message and tries again with the second MID server.
Logging and Status Update: After the discovery attempts, the script logs the results and updates the current context with the discovery status.

This code enhances device discovery in ServiceNow, making the process more reliable by utilizing multiple MID servers.
@snamjosh snamjosh self-assigned this Oct 1, 2024
@snamjosh
Copy link
Contributor

snamjosh commented Oct 1, 2024

Hello @selvarun-umass Thank you for your contribution. However, it doesn’t comply with our contributing guidelines. As a reminder, the general requirements (as outlined in the CONTRIBUTING.md file) are the following: follow the folder+subfolder guidelines and include a readme.md file explaining what the code snippet does. Review your contribution against the guidelines and make the necessary adjustments. Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.

@snamjosh snamjosh closed this Oct 1, 2024
@selvarun-umass
Copy link
Contributor Author

selvarun-umass commented Oct 1, 2024

@snamjosh Thank you for your response, I will take a look and get back if I have any doubts. This is my first time using GitHub, I will look into it.

@selvarun-umass selvarun-umass deleted the Code-Snippets branch October 2, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants