jxmot / router-log-monitor

A utility that monitors Netgear R6400 logs received via email(IMAP). It processes them and parses each entry for writing into a database.
MIT License
0 stars 0 forks source link
log-file netgear-r6400 netgear-router node php

This project is a work in progress. Please be patient.

Router Log Monitor

The purpose of this project is to aid in the monitoring of logs generated by a Netgear R6400 router. I have configured it to email a log every day at midnight.

Every once in a while I would find evidence of an unauthorized access to the WiFi access point, or some other suspect activity. And not having time to look through logs every day I decided to automate the process a little.

Overview

The primary components in this project are:

There are three separate applications in this project. The first is written in PHP and its purpose is to download the log email messages and write their content to a log file. The second part is a Node.js application that watches and waits for new log files to be created. When one or more is detected this application will read the log file, parse it, and write the results to a database across multiple tables. The third part is the report generator application. It reads the data previously processed by the log watcher and provides an endpoint for retrieving various reports.

Project Folders

This is the folder structure of this project:

\router-log-monitor 
    |
    +---logcollector
    |
    +---logwatcher
    |   +---keys
    |   +---mysql
    |   |
    |   +---logs
    |
    +---logreporter
    |   +---mysql
    |   +---sql
    |   +---public_html
    |   |
    |   +---logs
    |
    +---logoutput
    |   +---oldlogs
    |
    +---sql

Downloading this Repository

It is strongly recommended that you download a release instead of cloning this repository. Releases > 1.0.0 should be OK for use, anything older than that is experimental and good results are not guaranteed.

Additional Documentation