Skip to content

Instantly share code, notes, and snippets.

View hirolovesbeer's full-sized avatar

Hiroshi hirolovesbeer

View GitHub Profile

第5回Webシステムアーキテクチャ研究会

発表者

  • 阿部 博
  • 所属
    • (察して)
    • 情報通信研究機構 協力研究員
    • Interop Tokyo ShowNet NOCメンバー(2015年〜)

第4回 Webシステムアーキテクチャ研究会

"Ultra Scale Edge Log Processing using Service Mesh Architecture"

発表者

  • 阿部 博
  • 肩書き・所属
    • 北陸先端科学技術大学院大学 博士(情報科学)
  • 株式会社レピダム 研究員

第3回Webシステムアーキテクチャ研究会

大規模なネットワーク/システム/サービス監視についてのお話

発表者

第2回Webシステムアーキテクチャ研究会

セキュリティ研究事始め

発表者

  • 阿部 博
  • https://hirolovesbeer.github.io/
  • 所属
  • 株式会社レピダム 研究員
  • 情報通信研究機構 協力研究員
  • 北陸先端科学技術大学院大学 博士後期課程 4年
@hirolovesbeer
hirolovesbeer / simple_python_datasource.py
Created July 24, 2017 02:56 — forked from linar-jether/simple_python_datasource.py
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
import os.path
import sqlite3
#import time
#start = time.time()
db_file = 'test2.db'
log_file = '1m.log'
#db_file = 'test3.db'
#log_file = 'monitor_syslog.log'
import os.path
import sqlite3
db_file = 'test2.db'
if not os.path.exists(db_file):
conn = sqlite3.connect(db_file)
conn.execute("create virtual table syslog using fts3(logs)");
conn = sqlite3.connect(db_file)
CentOS 7.2におけるiptablesを用いたsyslog転送設定
+-----+ +-----+ +-----+
|host1| -> |host2| -> |host3|
+-----+ +-----+ +-----+
- host1(10.0.0.1) = syslogを送信するホスト(send-syslog.py <- 自作syslog送信pythonプログラム)
- host2(10.0.0.2) = syslogを転送するホスト(iptablesのNAT設定)
- host3(10.0.0.3) = syslogを受信するホスト(rsyslog)
import netsyslog
import syslog
logger = netsyslog.Logger()
logger.add_host("192.168.0.1")
for i in range(0, 99):
msg = "Hey, it works " + str(i)
# logger.log(syslog.LOG_USER, syslog.LOG_NOTICE, "Hey, it works!", pid=True)
logger.log(syslog.LOG_USER, syslog.LOG_NOTICE, msg, pid=True)
#! /usr/bin/env python
import sys
from scapy.all import sniff
#sniff(iface="en0", prn=lambda x: x.show(), filter="udp")
sniff(iface="en0", prn=lambda x: x.show(), filter="udp and ( port 514 )")
#sniff(iface="en0", prn=lambda x: x.summary(), filter="udp and ( port 514 )")