diff --git a/check_datorhandbok b/check_datorhandbok index 2fbfccc18ae771c7bbb0538c85ba96ce753b3762..90535bbc416f2edab464985892564fa379c72c2b 100755 --- a/check_datorhandbok +++ b/check_datorhandbok @@ -41,6 +41,11 @@ def check_host(hostname): if csub.findNext(attrs={"alt": "#REDIRECT"}): warning(hostname, "broken redirect") + redirected_from = tree.find( + "a", + attrs={"href": + "/index.php?title=%s&redirect=no" % hostname.capitalize()}) + firstpara = csub.findNext("p").string if firstpara == u"(Det finns för tillfället ingen text på den här sidan.)\n": warning(hostname, "not documented") @@ -48,9 +53,7 @@ def check_host(hostname): if not csub.findNext(attrs={"href": nagios_url(hostname)}): warning(hostname, "Nagios link missing") - if not csub.findNext(attrs={"href": re.compile( - "^https://webware.lysator.liu.se/lysinv/Thing\\?id=")}): - + if redirected_from is None and not csub.findNext(attrs={"id": "LysINV"}): warning(hostname, "LysINV link missing") ok(hostname, "all ok")