Working a requirement to retrieve data using a URI via http script monitor.
In this case license expiration data for a program called Nexus which I believe is a developer support tool.
In my shop we do a lot of URI monitoring, mostly using Powershell script monitors that execute the Invoke-WebRequest command.
In this case the engineer I'm working with provided a CURL command for access as listed below (note that username/password, ANTI-CSRF-TOKEN, and specific URI are samples, not actual):
curl -u admin:admin123 -X 'GET' \
'https:/.../license' \
-H 'accept: application/json' \
-H 'NX-ANTI-CSRF-TOKEN: 0.123456789123456789' \
-H 'X-Nexus-UI: true'
I have a couple of questions about this:
- in my world plain text passwords are a big no-no. I want to keep my username/password in the Solarwinds SAM credential store. If so, how do I provide this credential to the CURL command?
- Or... can I just use the CURL command in a regular PowerShell script monitor, where I know how to retrieve and apply credentials from Solarwind?
- Or... can I / should I just forget about CURL and translate the command into Invoke-WebRequest (I'm pretty uncertain about how to render the '-H 'accept: application/json' \
-H 'NX-ANTI-CSRF-TOKEN: 0.123456789123456789' \
-H 'X-Nexus-UI: true' ' part).
Thanks in advance for any thoughts / advice from the community.