Note The code herre and indicative. I only worked on the Devops tools i know (Graffana and Dockerfile ) asumming the SQL DATABASE ALREADY EXIST
Here are your assignment instructions from Abdul. Please see below. You will have 24 hours to complete this, so please send this back no later than Thursday, August 18 at 3 p.m. EST.
Step 1: Write an efficient multithreaded script in Python or Java that polls an array of URLs called miner_ips[] via HTTP requests. Each URL returns a JSON in the following format:
{"miner_state":"mining","miner_ip":"10.10.10.10","miner_state_time":45441.0,"find_miner":false,"restart_required":false,"reboot_required":false,"unlocked":false}
Step 2: Continue to parse the JSON API and insert the data into a table called miner_status. Assume that the table has columns for each item in the JSON. You can assume that the database is a database of your choice (PostgreSQL, MySQL, MongoDB, etc.).
Step 3: Schedule this script to run every 2 minutes in order to update the table. On future polls, miner_status will need to be UPDATED based on miner_ip. Make a list of all the steps and commands you would follow to dockerize and run your application.
Bonus Step: In a nutshell, in a few steps, explain how you can monitor this data using Grafana, Prometheus, or any other monitoring tool and how you plan to create alerts/tickets to various personnel within the organization. Ideally, all miner_ip's with reboot_required is "true" will need to be flagged every 5 minutes.
P.S. you do not have to compile your code and it does not need to run. The purpose of this assignment is to assess your thought process and knowledge. It should not take longer than 2-3 hours.