Page 1 of 1
Broken Links in Website
Posted: Sun Sep 16, 2012 2:30 am
by vijragha
Hi Support,
I want to crawling into the websites and find the broken links. Is that possible in Nagios?
Thanks in advance
Vijay.
Re: Broken Links in Website
Posted: Sun Sep 16, 2012 5:35 pm
by jsmurphy
You could write a script that did this but I don't think there are any existing plugins that do it.
Re: Broken Links in Website
Posted: Mon Sep 17, 2012 2:08 am
by vijragha
Thank you very much jsmurphy for your quick reply
Re: Broken Links in Website
Posted: Mon Sep 17, 2012 10:33 am
by mguthrie
Yeah, in theory what you'd have to do is:
- use curl to grab the page content
- use a regular expression match to pull all of the links into some sort of list or array
- loop through the list of links and make a curl request for each link found on the page, check the http error code returned by curl.