diff --git a/check_datorhandbok b/check_datorhandbok index b3df9190740e7b5be24832af1742bea0fed763b6..6ecfb10fb5adc6556bb45946fdeed29c1a25403d 100755 --- a/check_datorhandbok +++ b/check_datorhandbok @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import re import urllib2 import BeautifulSoup @@ -37,11 +38,16 @@ def check_host(hostname): if firstpara == u"(Det finns för tillfället ingen text på den här sidan.)\n": warning(hostname, "not documented") - if csub.findNext(attrs={"href": nagios_url(hostname)}): - ok(hostname, "all ok") - else: + 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=")}): + + warning(hostname, "LysINV link missing") + + ok(hostname, "all ok") + if __name__ == '__main__': import sys