This project allows to set up environment on a Vagrant box VM with a monitoring system, a web server and a simple application. System monitors certain application parameter with alerting enabled when parameter exceeds certain threshold.
Following technologies were choosen for task implementation:
- Ubuntu 14.04 - operation system
- Apache2 - web server
- Nagios3 - monitoring system
- Bottle Py - Python framework as a simple application
- SSL - cryptographic protocol
To get started you should check that following preconditions on your local PC are met
"Virtualization" option is enabled in BIOS setup
Next tools should be installed:
- Virtual Box - tool for virtualization
- Vagrant - tool for virtualization
- Ansible - configuration management tool for provisioning
- Locust - load testing tool
If you don't have these tools and you have Debian or RHEL 6.x you can simple install all needed preconditions running:
sudo ./install_env_preconditions.sh
-
Run "install_env_preconditions.sh" script (optional)
-
Run command:
vagrant up
-
After testing environment deployment open next links:
- HTML page - this is a simple HTML page for Apache server testing
- Nagios - Nagios monitoring system via SSL
- Application - Simple Application which returns system load average per one minute. Here is implemented a reverse proxy from web server.
-
Credentials for Nagios:
- login: nagiosadmin
- pass: nagiosadmin
-
New plugin services added to Nagios:
- APPLICATION - simple Application monitoring
- LINUX STATS CPU - CPU monitoring
- LINUX STATS DISK - Disk monitoring
- LINUX STATS PROCESS - Processes monitoring
-
Stress testing uses Locust framework to simulate the load of clients and requests. Application Nagios plugin measures system load average per one minute and checks next ranges:
- OK - from 0.00 to 0.05
- WARNING - from 0.05 to 0.1
- CRITICAL - from 0.1 and above
-
Run stress test using Locust wrapper with 100 numbers of clients and 5 rates per second in which clients are spawned by default:
./stress_testing.sh
-
Also you can specify number of concurrent clients and rates per second:
./stress_testing.sh [CLIENTS] [HATCH-RATE]
-
Please keep in mind that Nagios plagin updates every few minutes so there may be delays