This Flask application is designed to help network SREs create a report for their on-call rotation. The report tracks tickets, alerts, incidents, and notes throughout the week, and generates a summary report at the end of the shift.
- Add Tickets: Add URLs of tickets opened during your on-call shift along with their status.
- Track Alerts: Upload alert files (spreadsheet links).
- Record Incidents: Log incidents and mark them as relevant to the team.
- Add Notes: Capture any other relevant information or notes for the report.
- Generate Report: View a weekly report summarizing the tickets, alerts, incidents, and notes.
- Python 3.7 or higher
- MySQL or MariaDB installed and running
git clone https://github.com/labrack/oncall-report.git
cd oncall-reportpython3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`pip install -r requirements.txt-
Log in to your MySQL instance:
mysql -u your_username -p
-
Create a new database:
CREATE DATABASE oncall_report;
-
(Optional) Create a new user and grant privileges:
CREATE USER 'flaskuser'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON oncall_report.* TO 'flaskuser'@'localhost'; FLUSH PRIVILEGES;
-
Update the Flask app configuration in
app.py:app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://flaskuser:your_password@localhost/oncall_report'
After setting up MySQL and configuring the connection string, initialize the database tables by running the following commands:
python
>>> from app import app, db
>>>
>>> with app.app_context():
... db.create_all()
...
>>> exit()Start the Flask development server:
python app.pyVisit the app at http://localhost:5000.
- Add Ticket: Navigate to
/add_ticketto add a new ticket with its status. - Add Alert: Navigate to
/add_alertto upload an alert file (or its path). - Add Incident: Navigate to
/add_incidentto log incidents. - Add Note: Navigate to
/add_noteto log any other notes. - Generate Report: Visit
/reportto view the weekly summary report.
This project is licensed under the Unlicense. See the LICENSE file for more details.