Broken Links in Website

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vijragha
Posts: 7
Joined: Wed Aug 22, 2012 3:55 am

Broken Links in Website

Post 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.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Broken Links in Website

Post by jsmurphy »

You could write a script that did this but I don't think there are any existing plugins that do it.
vijragha
Posts: 7
Joined: Wed Aug 22, 2012 3:55 am

Re: Broken Links in Website

Post by vijragha »

Thank you very much jsmurphy for your quick reply
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Broken Links in Website

Post 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.
Locked