summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorroot <root@vm-staticweb.spline.inf.fu-berlin.de>2013-09-26 11:01:14 +0200
committerroot <root@vm-staticweb.spline.inf.fu-berlin.de>2013-09-26 11:01:14 +0200
commit33fa0c460e35619f2b196e9cb01de28fca6c9c2e (patch)
treed62206d7355cee5a2a2221efe63c6c4f2c55d96b /templates
parent51166271ff79acb2f15f6060505f65de688adf9d (diff)
parente41fa2d271bd13275a5d49a1dd68028d298b964b (diff)
downloadwww-33fa0c460e35619f2b196e9cb01de28fca6c9c2e.tar.gz
www-33fa0c460e35619f2b196e9cb01de28fca6c9c2e.tar.bz2
www-33fa0c460e35619f2b196e9cb01de28fca6c9c2e.zip
Merge branch 'master' of ssh://git.spline.de/hostinfo-wwwHEADmaster
Diffstat (limited to 'templates')
-rw-r--r--templates/host.dokuwiki78
-rw-r--r--templates/host.html6
-rw-r--r--templates/index.dokuwiki23
3 files changed, 107 insertions, 0 deletions
diff --git a/templates/host.dokuwiki b/templates/host.dokuwiki
new file mode 100644
index 0000000..f377ac8
--- /dev/null
+++ b/templates/host.dokuwiki
@@ -0,0 +1,78 @@
+{# {% extends 'layout.html' %}
+
+{% block title %}{{hostname}}{% endblock %} #}
+
+{% block content %}
+====== {{hostname|replace('.spline.inf.fu-berlin.de', '')}} ======
+
+{{description}}
+
+===== Summary =====
+
+* **hostname:** {{hostname}}
+* **os:** {{os|default('unknown')}}
+* **arch:** {{arch|default('unknonw')}}
+{% if vserver %}
+* **vserver:** {{vserver}}
+{% endif %}
+{% if vserver_host %}
+* **vserver host:** {{vserver_host}}
+{% endif %}
+{% if maintainers is iterable %}
+* **maintainers:**
+{% for maintainer in maintainers %}
+{% set name, mail = get_contact_info(maintainer) %}
+ * [[mailto:{{mail}}|{{name}}]]
+{% endfor %}
+{% endif %}
+{% if groups is defined %}
+* **bcfg2-groups:**
+{% for group in groups %}
+ * {{group}}
+{% endfor %}
+
+( [[https://bcfg2.spline.de/client/{{hostname}}|view client in bcfg2]] )
+{% endif %}
+
+
+===== network interfaces =====
+
+{% for group in addresses | select_with_attribute('vserver', False) | groupby('interface') %}
+* **{{ group.grouper }}**
+{% for address in group.list %}
+ * {{address['address']}}/{{address['netmask']}}
+{% else %}
+ * no address
+{% endfor %}
+{% else %}
+No network interfaces configured.
+{% endfor %}
+
+
+===== open ports =====
+
+{% if ports is iterable %}
+^ Port ^ IP ^ Process ^ Protocol ^
+{% for port in ports %}
+| {{port['port']}} | {{port['ip']}} | {{port['process']}} | {{port['proto']}} |
+{% endfor %}
+{% else %} No open ports
+{% endif %}
+
+===== services =====
+
+
+{% if services is iterable %}
+^ Name ^ Port ^ Visibility ^
+{% for service_category in services %}
+{% if services[service_category] is iterable %}
+{% for service in services[service_category] %}
+| {% if service is string %} {{service}} {% else %} {{service.items()[0][0]}} {% endif %} | {% if service is string %} default {% else %} {{service.items()[0][1]}} {% endif %} | {{service_category}} |
+{% endfor %}
+{% endif %}
+{% else %}
+no services provoided
+{% endfor %}
+{% endif %}
+
+{% endblock %}
diff --git a/templates/host.html b/templates/host.html
index 9fa1b82..4eabea9 100644
--- a/templates/host.html
+++ b/templates/host.html
@@ -7,9 +7,15 @@
<ul class="nav nav-tabs">
<li class="active"><a href="#info" data-toggle="tab">Info</a></li>
+ {% if ports is iterable %}
<li><a href="#ports" data-toggle="tab">Ports</a></li>
+ {% endif %}
+ {% if interfaces is iterable %}
<li><a href="#interfaces" data-toggle="tab">Interfaces</a></li>
+ {% endif %}
+ {% if services is defined %}
<li><a href="#services" data-toggle="tab">Services</a></li>
+ {% endif %}
<li class="pull-right"><a id="index" href="index.html">back to index</a></li>
</ul>
diff --git a/templates/index.dokuwiki b/templates/index.dokuwiki
new file mode 100644
index 0000000..6f1e1e8
--- /dev/null
+++ b/templates/index.dokuwiki
@@ -0,0 +1,23 @@
+{% block content %}
+====== Hostinfo ======
+
+{% for host in hosts|sort(attribute='hostname') %}
+{% set os = host['os'] | get_os_name %}
+* {{ '{{' }}
+ {%- if os is not none %}
+ {{- host['os'] | get_os_name}}.png
+ {%- else %}
+unknown.png
+ {%- endif %}?20x20
+ {{- '}}' }} {{ host['hostname'] | replace(".spline.inf.fu-berlin.de","")}}
+{% if host['description'] is defined %}
+ * **description:**{{host['description'] | replace("\n"," ")}}
+{% else %}
+ * no description yet
+{% endif %}
+ * **adresses:**
+{% for ip in host['addresses'] | select_with_attribute('vserver', False) | sort(attribute='address') %}
+ * {{ip['address']}}
+{% endfor %}
+{% endfor %}
+{% endblock %}