first
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import os
|
||||
import datetime
|
||||
from rrdtool import update as rrd_update
|
||||
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, json, make_response
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
# configuration
|
||||
DEBUG = False
|
||||
SECRET_KEY = 'Mdevelopment key'
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(__name__)
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def index():
|
||||
'''
|
||||
pick up data for rrd's
|
||||
'''
|
||||
if request.method == 'GET':
|
||||
if 'binnen' in request.args:
|
||||
ret = rrd_update(os.path.join('/var/www/suy.nl/w/fromhue.rrd'), request.args['binnen'])
|
||||
return "Ok", 200
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.secret_key = 'a38738svnlsfnviureiue598y3498f34ifjoielknf 3o4ifj o3i4f o3i4ufho3i4iwe34'
|
||||
app.run(host='0.0.0.0', port=8080)
|
||||
|
||||
Reference in New Issue
Block a user