Introduction

Cluster Monitor Agent is an internal tool that monitors the cluster resources. It helps the infrastructure team to keep track of the hardware specifications and resource usages of a Linux cluster. It also helps to persist the data in an RDBMS databse

Architecture and Design

Architecture:

Server-host

Tables:
host_info stores the hardware specification information whereas host_usage stores the resource usages information. There are two scripts written namely, host_info.sh which collects the host hardware information and then inserts these information to the table host_info in the database. This script is execute once. host_usage.sh collects the current host usage and then insert the data into host_usage table. Crontab is used to trigger this script every minute. init.sql creates a database and two tables

Usage

  1. psql -h localhost -U postgres -W host_agent -f init.sql to execute init.sql

  2. host_info.sh usage: bash host_info.sh psql_host psql_port db_name psql_user psql_password

  1. host_usage.sh usage: bash host_usage.sh psql_host psql_port db_name psql_user psql_password

  2. crontab setup: * * * * * /home/centos/dev/jrvs/bootcamp/host_agent/scripts/host_usage.sh localhost 5432 host_agent postgres password > /tmp/host_usage.log

Improvement

  1. handle hardware update
  2. improve sql search
  3. normalized sql tables