Scripting multiple URL Ping Availability Tests

%3CLINGO-SUB%20id%3D%22lingo-sub-2321710%22%20slang%3D%22en-US%22%3EScripting%20multiple%20URL%20Ping%20Availability%20Tests%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2321710%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Community%2C%3CBR%20%2F%3EWe%20have%20many%20URLS%20we'd%20like%20to%20include%20to%20monitor%20URL%20ping%20availability%20tests.%3CBR%20%2F%3E%3CEM%3E%3CSTRONG%3E%3CBR%20%2F%3EWe've%20set%20up%20a%20handful%20manually%2C%20is%20there%20a%20way%20to%20use%20a%20list%20of%20variables%20to%20script%2Fload%20multiple%20url%20tests%20via%20PowerShell%20or%20other%20method%20%3F%3C%2FSTRONG%3E%3C%2FEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20have%20an%20idea%20how%20this%20could%20be%20done%20via%20Bash%20shell%20script%20with%20variables%20and%20.csv%20file%20ala%20%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3E%26nbsp%3Bpseudo%20bash%20code%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FP%3E%3CP%3E%23!%2Fbin%2Fbash%3CBR%20%2F%3E%23%3CBR%20%2F%3EINPUT%3D%3CSTRONG%3Eurl_and_settings.csv%3C%2FSTRONG%3E%3CBR%20%2F%3EOLDIFS%3D%24IFS%3CBR%20%2F%3EIFS%3D'%7C'%3CBR%20%2F%3E%5B%20!%20-f%20%24INPUT%20%5D%20%26amp%3B%26amp%3B%20%7B%20echo%20%22%24INPUT%20file%20not%20found%22%3B%20exit%2099%3B%20%7D%3CBR%20%2F%3Ewhile%20read%20-r%20NAME%20SKU%20URL%20FREQ%20LOCATION1%20LOCATION2%20LOCATION3%20TIMEOUT%20CODE%20ALERTS%3CBR%20%2F%3Edo%3CBR%20%2F%3E.............%3CBR%20%2F%3E........%3CBR%20%2F%3E....%3CBR%20%2F%3Edone%20%26lt%3B%20%24INPUT%3CBR%20%2F%3EIFS%3D%24OLDIFS%3CBR%20%2F%3Eexit%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3E%26nbsp%3B%3CSTRONG%3Eurl_and_settings.csv%3C%2FSTRONG%3E%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FP%3E%3CP%3Eclient01-name%20%7C%20%3CA%20href%3D%22https%3A%2F%2Fclient01.url.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fclient01.url.com%3C%2FA%3E%20%7C%20URL%20ping%20%7C%205%20minutes%20%7C%20West%20Europe%20%7C%20West%20US%20%7C%20North%20Europe%20%7C%2060%20%7C%20200%20%7C%20Enabled%3CBR%20%2F%3Eclient02-name%20%7C%20%3CA%20href%3D%22https%3A%2F%2Fclient02.url.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fclient02.url.com%3C%2FA%3E%20%7C%20URL%20ping%20%7C%205%20minutes%20%7C%20Japan%20East%20%7C%20UK%20South%20%7C%20France%20Central%20%7C%2030%20%7C%20200%20%7C%20Enabled%3CBR%20%2F%3Eclient03-name%20%7C%20%3CA%20href%3D%22https%3A%2F%2Fclient03.url.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fclient03.url.com%3C%2FA%3E%20%7C%20URL%20ping%20%7C%205%20minutes%20%7C%20West%20Europe%20%7C%20UK%20West%20%7C%20North%20Europe%20%7C%20120%20%7C%20200%20%7C%20Enabled%3CBR%20%2F%3Eclient04-name%20%7C%20%3CA%20href%3D%22https%3A%2F%2Fclient04.url.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fclient04.url.com%3C%2FA%3E%20%7C%20URL%20ping%20%7C%205%20minutes%20%7C%20Brazil%20South%20%7C%20West%20US%20%7C%20Central%20US%20%7C%2060%20%7C%20200%20%7C%20Enabled%3CBR%20%2F%3E....%3CBR%20%2F%3Eclient99-name%20%7C%20etc....%7C%20etc...%7C....%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E---------------------------------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIdeally%20we'd%20like%20to%20provide%20a%20list%20of%20inputs%20needed%20for%20an%20URL%20Availabiltiy%20test%20that%20the%20script%20would%20read%20and%20run%20each%20url%20input%20set%20through%20the%20script%20to%20add%20many%20url%20availability%20tests%20at%20once.%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20your%20time.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3C%2FP%3E%3CP%3EDonald%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EP.S.%3CBR%20%2F%3EReading%20these%20today%20has%20helped%20with%20my%20overall%20understanding%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fapp%2Fmonitor-web-app-availability%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fapp%2Fmonitor-web-app-availability%3C%2FA%3E%3CBR%20%2F%3E2.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fswimburger.net%2Fblog%2Fazure%2Frun-availability-tests-using-powershell-and-azure-application-insights%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fswimburger.net%2Fblog%2Fazure%2Frun-availability-tests-using-powershell-and-azure-application-insights%3C%2FA%3E%3CBR%20%2F%3E3.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.ApplicationInsights%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.ApplicationInsights%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi Community,
We have many URLS we'd like to include to monitor URL ping availability tests.

We've set up a handful manually, is there a way to use a list of variables to script/load multiple url tests via PowerShell or other method ?


We have an idea how this could be done via Bash shell script with variables and .csv file ala ;

=============
 pseudo bash code
=============

#!/bin/bash
#
INPUT=url_and_settings.csv
OLDIFS=$IFS
IFS='|'
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read -r NAME SKU URL FREQ LOCATION1 LOCATION2 LOCATION3 TIMEOUT CODE ALERTS
do
.............
........
....
done < $INPUT
IFS=$OLDIFS
exit


==============
 url_and_settings.csv
==============

client01-name | https://client01.url.com | URL ping | 5 minutes | West Europe | West US | North Europe | 60 | 200 | Enabled
client02-name | https://client02.url.com | URL ping | 5 minutes | Japan East | UK South | France Central | 30 | 200 | Enabled
client03-name | https://client03.url.com | URL ping | 5 minutes | West Europe | UK West | North Europe | 120 | 200 | Enabled
client04-name | https://client04.url.com | URL ping | 5 minutes | Brazil South | West US | Central US | 60 | 200 | Enabled
....
client99-name | etc....| etc...|....


---------------------------------------------------------------------------------------------------------------

 

Ideally we'd like to provide a list of inputs needed for an URL Availabiltiy test that the script would read and run each url input set through the script to add many url availability tests at once.

Thank you for your time.

Best Regards,

Donald

 

P.S.
Reading these today has helped with my overall understanding:

1.
https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-web-app-availability
2.
https://swimburger.net/blog/azure/run-availability-tests-using-powershell-and-azure-application-insi...
3.
https://www.nuget.org/packages/Microsoft.ApplicationInsights/

0 Replies