Radical Designs needed a tool to update their rotating on-call list each month. The were already making use of WordPress for their internal documentation. To tie the two together A script was written to log into the WordPress site, parse a contact list, and then rotate and update the on-call list from the WordPress blog page managed by staff to the Nagios contact config. The on-call rotation was triggered throughout the day (in case a shift was swapped by updating the WordPress page) via Cron.

This is what main looks like:

# Setup our web browser
our $MECH = WWW::Mechanize->new();
authenticate();

# If we have entered a new month the schedule should be updated
update_oncall_webpage();

# Pull the current schedule
my %web_schedule = get_current_schedule_from_web();

# update nagios
update_nagios(%web_schedule);

And the cron trigger:

# We run the update oncall script before each shift
0 5 * * * /root/bin/updateoncall/trunk/update_oncall.pl
0 13 * * * /root/bin/updateoncall/trunk/update_oncall.pl
0 21 * * * /root/bin/updateoncall/trunk/update_oncall.pl

This utility is custom for a specific wordpress site and was never generalized for use outside of Radical Designs. If you would like me to configure something similar for your team or would like more information about this utility, contact me.

Employer: 
Start: 
2015
End: 
2017