Skip to content
Snippets Groups Projects
Commit e2b3f926 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Check that a LysINV link exists

parent 8ef63b4a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re
import urllib2 import urllib2
import BeautifulSoup import BeautifulSoup
...@@ -37,11 +38,16 @@ def check_host(hostname): ...@@ -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": if firstpara == u"(Det finns för tillfället ingen text på den här sidan.)\n":
warning(hostname, "not documented") warning(hostname, "not documented")
if csub.findNext(attrs={"href": nagios_url(hostname)}): if not csub.findNext(attrs={"href": nagios_url(hostname)}):
ok(hostname, "all ok")
else:
warning(hostname, "Nagios link missing") 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__': if __name__ == '__main__':
import sys import sys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment