From e2b3f92647d0fcb00161eadc1c97a58b90ad0421 Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Thu, 28 Dec 2006 15:08:51 +0000
Subject: [PATCH] Check that a LysINV link exists

---
 check_datorhandbok | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/check_datorhandbok b/check_datorhandbok
index b3df919..6ecfb10 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
 
-- 
GitLab