/monitoringSystem

system that will enable health monitoring of webservers in the cloud

Primary LanguageJavaScript

monitoringSystem

system that will enable health monitoring of webservers in the cloud

this system developed with nodejs and mysql database .

there are 2 tables:

1. servers (serverName ,urlServer , lasatStatus , healthly, unHealthly and last monitor)

image

every 60 seconds system monitor all servers url status by api request and store the status in table called monitorHistory (id , serverName , statusResponse , monitorTime , latincyTime)

image

It is possible using API to:

  • create new servers
  • edit a server
  • delete a server
  • display all servers (in servers table) and their current heallt status
  • display detailts about specific webserver request history logs

Pre-requisites :

install Node.js

clone the repository:

git clone

install dependencies:

  • npm i express
  • npm i axios
  • npm i node-schedule
  • npm i perf_hooks
  • npm i env

create ".env" file in "backend1" folder and add process.env.MYSQL_PASSWORD :

process.env.MYSQL_HOST = '127.0.0.1' process.env.MYSQL_USER = 'root' process.env.MYSQL_PASSWORD = ' ' process.env.MYSQL_DB = 'server_monitoring'

create 2 table in mysql:

""" CREATE DATABASE server_monitoring; USE server_monitoring;

CREATE TABLE servers ( serverName VARCHAR(255) PRIMARY KEY NOT NULL, urlServer TEXT NOT NULL, statusServer VARCHAR(255) NOT NULL, healthly integer DEFAULT 0, unHealthly integer DEFAULT 0, lastMonitor TIMESTAMP NOT NULL DEFAULT NOW() );

CREATE TABLE monitorHistory ( id integer PRIMARY KEY AUTO_INCREMENT, serverName VARCHAR(255) NOT NULL, statusResponse integer NOT NULL, monitorTime TIMESTAMP NOT NULL DEFAULT NOW() );

"""

also in schema.sql file

finnaly run coomand in terminal :

npm run dev

** There are thunder collection file, using this file you can create api requests.

image

home page: homePage

Dashboard page (list of all server monitoring and logs in real time) dashboardPage