Join us
@squadcast ă» Jun 16,2024 ă» 5 min read ă» 230 views ă» Originally posted on www.squadcast.com
This blog post explores on-call rotations, a system where a team of engineers are designated to handle critical issues outside of regular business hours. It highlights the importance of on-call scheduling software for managing these rotations and ensuring smooth handoffs.
The blog offers a solution using Squadcast's on-call scheduling system, which includes features like customizable rotations and automated notifications. It also provides a script to automate on-call notifications on platforms like Slack.
Key takeaways include:
Understanding on-call rotations and their benefits for handling critical issues.
Importance of on-call scheduling software for managing rotations and notifications.
A solution using Squadcast's on-call scheduling system and a script for automated notifications.
The blog concludes by recommending Squadcast's on-call scheduling software for a comprehensive solution and offers a free on-call onboarding checklist.
An Easy Way to Manage On-Call Rotations
On-call engineers are the initial line of defense when a system outage occurs, ensuring that critical services impacting customers are quickly identified and resolved. This blog post will explore some of the use cases that can help you avoid pitfalls in your organizationâs on-call rotation process. Youâll also learn how to get free access to an on-call onboarding checklist.
A common first step for organizations towards achieving reliability for their customers and users is to implement an on-call rotation. In an on-call rotation, on-call engineers act as the first responders, ensuring that outages impacting customers are addressed swiftly.
We, at Squadcast, use our own on-call rotation system built on our platform. This system supports many customizable on-call rotation options, including:
Our system also allows you to create multiple scheduling layers within a single schedule.
On-call scheduling scripts can help you view on-call responsibilities. These scripts can help you find out who is on-call at a given time and which Slack channel to use to send on-call notifications for a particular schedule.
The script retrieves a list of people who are on-call for a specified Squadcast Schedule across all the shifts, at the time the script is run. It then sends this list to a Slack channel.
Script Inputs
The script requires a configuration JSON file as a command-line argument. The configuration file looks something like this:
JSON
{
"REFRESH_TOKEN": "Squadcast Refresh Token which will be used to be make requests to Public APIs",
"SCHEDULE_NAME": "Name of the schedule for which we are getting the on-call people",
"SLACK_WEBHOOK_URL": "Slack incoming webhook URL for the channel to which we want to send the on-call notification"
}
git clone git@github.com:SquadcastHub/who-s-oncall-slack.git
Now that you have your âparams.jsonâ file ready, youâll need to build the script and configure cron.
Note: Youâll need Golang installed on your system to build this script.
go build
./oncall <path_to_params.json>
Setting Up Cron Job in Linux
The script itself doesnât handle scheduling its execution. Youâll need to set up a cron job to automate this process.
crontab -e
0 12 * * 1 <path_to_binary> <path_to_params.json>
Replace the following placeholders in the command:
<path_to_binary>
: Absolute path to the script binary (e.g., /home/oncall).<path_to_params.json>
: Absolute path to the params.json file (e.g., /home/params.json).For more details on using the crontab
command, you can check out its manual page by running the following command:
man crontab
You can also refer to these resources for additional help with cron jobs:
Important Note Regarding Cron Job Frequency
Once the cron job is set up, youâll receive notifications on the designated Slack channel about the new on-call users whenever the script runs.
Yes! You can modify the script to work with other chat platforms. Simply replace the NotifySlack
function with your own functions named NotifyHangouts
or NotifyTeams
, following the respective chat platform's API documentation for setting up notifications.
The current API doesnât support grouping usernames by shift names. However, the script will be updated to reflect this functionality when itâs incorporated into the API.
Absolutely! You can create multiple params.json
files with different configurations and set up the cron job to run the script with each unique configuration.
For instance, if you have two params.json
files with absolute paths /home/params1.json
and /home/params2.json
and the binary at /home/oncall
, you can add the following lines to your crontab file:
0 12 * * 1 /home/oncall /home/params1.json
0 12 * * 1 /home/oncall /home/params2.json
This configuration allows you to:
By implementing on-call rotations and using on-call scheduling software, you can ensure your team is prepared to handle critical issues efficiently. This blog post provided a helpful overview of on-call rotations, on-call scheduling software, and on-call rotation generators. It also offered a solution for managing on-call responsibilities using Squadcastâs on-call scheduling system and a script to automate on-call notifications.
Squadcast is a Popular Pagerduty Alternative, Incident Management tool thatâs purpose-built for SRE. Get rid of unwanted alerts, receive relevant notifications and integrate with popular ChatOps tools. Work in collaboration using virtual incident war rooms and use automation to eliminate toil.
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.