Monitoring URL links

Brass Contributor

Is there any way , where we can monitor a URL link on azure monitor, if it goes down.

 

I have specified URL link at the bottom.

 

http://net-web1:2738

 

What's the best apparch with regards to this, having it in a Kusto query language in place or any other way. 

 

14 Replies

@Arslan11,

 

the easiest way is to set up an Availability Test in an Application Insights instance:

 

https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-web-app-availability

 

If you need to monitor the endpoint from a VM, you can also use Connection Monitor:

 

https://docs.microsoft.com/en-us/azure/network-watcher/connection-monitor-preview

 

You can then create Azure Monitor alerts based on the results of any of the approaches above.

@hspintoThanks for the response, I will update this post, if I will struggle with this.

@hspintoI had a look at the article, I would like to clarify one thing, the article is mentioning this

 

Create a URL ping test

 

To create your first availability request, open the Availability pane and select Create Test.

 
 

Once, I will create the availability test for the specified website, under application insights, will I get an alert via email, if the HTTP is unavailable for the specified website.

@hspintocan I have a update please 

 

@Arslan11 

 

as I mentioned earlier, after creating the Availability Test, you'll have to set up the alert to execute the required action, e.g., sending you an e-mail.

 

hspinto_0-1591609577444.png

Once the test is created, you can use the context menu to configure the alert rule.

hspinto_1-1591609679138.png

In the alert configuration blade, you'll have to create an action group to send you an e-mail whenever the alert fires/resolves. More details here.

@hspintoone more question, to ask you, can I add multiple websites  under one available test or I need to create individual available test for individual websites.

@Arslan11, you will have a ping test per URL (you can't have multiple URLs in a single ping test). However, if the multiple URLs you are testing are part of a specific application flow you want to validate, ensuring the full flow is responding correctly, then you should consider multi-step web tests instead. Multi-step web tests are more expensive. See pricing here.

Yes you can use availability test in your case to monitor the any url "xyz.com"

 

Go to Application insights   and select Availability test from panel.

 

@Srini1987  I did , that but I am afraid it didn't work.

 

I added a website to availability test

 

The website url link is not being monitored, the website was not loading today and I didn't got analert.

 

I did create an alert, to send any an email to the team, if HTTP is not responding.

 

Email didn't got send.

 

@hspinto 

I did , that but I am afraid it didn't work.

 

I added a website to availability test

 

The website url link is not being monitored, the website was not loading today and I didn't got analert.

 

I did create an alert, to send any an email to the team, if HTTP is not responding.

 

Email didn't got send.

@hspintoI have attaches screenshots to this post, please have a look

 

Screenshots attached includes Availability test, alert and action group.

 

Please review it and let me know, where I am going wrong.

 

And who is the best person to ask guidance on mars backup question 

 

 

@Arslan11 

 

maybe the alert had already fired before having e-mail notification set up and never resolved. Can you check if you have active alerts in the Azure Monitor alerts view? Change the time range filter to a larger period if needed.

 

Can you also change the URL being monitored to a valid one, wait for a "resolved" notification and then switch back to the failing URL to check if a "fired" notification is now coming?

 

hspinto_0-1594386622904.png

 

@hspinto  The reason for this not work is because my website is internal facing.

 

I found a alternative, any guidance on this, how can I get a example code to make a start on mine one

 

Write your own code to periodically test your internal server. Run the code as a background process on a test server behind your firewall. Your test process can send its results to Application Insights by using TrackAvailability() API in the core SDK package. This requires your test server to have outgoing access to the Application Insights ingestion endpoint, but that is a much smaller security risk than the alternative of permitting incoming requests. The results will appear in the availability web tests blades though the experience will be slightly simplified from what is available for tests created via the portal.

@Arslan11 

 

I thought the URL you were using was just a dummy one :D But this does not explain why the alerts were not firing, because they should fire no matter the URL being used.

 

Regarding the sample you're asking, you have this one, which is meant to run as an Azure Function, but you can reuse the code and put it in your application.

 

https://docs.microsoft.com/en-us/azure/azure-monitor/app/availability-azure-functions