Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dd15ad
commit b2dc741
Showing
7 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from flask import Blueprint, render_template | ||
|
||
mod_pollers = Blueprint('pollers', __name__, url_prefix='/pollers') | ||
|
||
|
||
@mod_pollers.route('/', methods=['GET']) | ||
def home(): | ||
return render_template('pollers/pollers.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- extend from base layout --> | ||
{% extends "base.html" %} | ||
{% block content %} | ||
|
||
<div class="page-header"> | ||
<h2>All Pollers</h2> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-lg-9"> | ||
<table class="table table-condensed"> | ||
<tr> | ||
<th>Name</th> | ||
<th>IP</th> | ||
<th>Port</th> | ||
<th>Status</th> | ||
<th>Online since</th> | ||
<th>Last healthpoll</th> | ||
</tr> | ||
{% for poller in pollers %} | ||
<tr> | ||
<td>{{ poller.name }}</td> | ||
<td>{{ poller.ip }}</td> | ||
<td>{{ poller.port }}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
</tr> | ||
{% else %} | ||
<tr><td colspan=6>No pollers found</td></tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
|
||
class Poller: | ||
"""A single poller connection""" | ||
|
||
def __init__(self, ip, port, name=None): | ||
""" Initialise task handler | ||
:param ip: Poller IP address | ||
:param port: Poller listening port | ||
:param name: Poller name | ||
""" | ||
self.ip = ip | ||
self.port = port | ||
self.port = name |