################################################################################
# oncall.pl - Version 1.0                                                      #
# Used to update on-call schedule for BB/Xymon e-mail notification             #
# (must be run as a user that can change /etc/mail/aliases and run newaliases) #
# - Created by Lisheng Chen, UMDNJ - user-013cb0d64e4c@xymon.invalid, (C) 2007-2010           #
################################################################################

1. Installation

1.1. Requirements

1) Locally running copy of sendmail or some other solution that allows specific
   pager e-mails to be maintained (this script changes the delivery path to 
   one e-mail address and one pager e-mail address to rotate the person on call) 
2) Functioning copy of perl with Time::Local available (any modern perl should do)
3) Ability to run the software as a user that can modify /etc/mail/aliases and run
   'newaliases' afterwards to generate the Sendmail aliases DB

1.2. Instructions

Place program in an appropriate place and modify beginning of perl script
appropriately to reflect proper PATH definitions. $BBHOME/oncall is not a bad
place.

Configure e-mail addresses to list the correct staff e-mail and pager addresses 
and configure the /etc/mail/aliases or equivalent file to reflect the on-call and
regular admin pager addresses.

Configure a schedule file, oncall_schedule, co-located with the perl script that 
contains your on-call rotation schedule in the following format:

MM/DD[/YY] - MM/DD[/YY]	Admin1
MM/DD[/YY] - MM/DD[/YY]	Admin2
MM/DD[/YY] - MM/DD[/YY]	Admin3

...and so on, where Admin1 will match the string $who_is_oncall in oncall.pl
(can be arbitrary, "First Last", "First L.", etc.

Add to crontab or other automated process to run this script at the desired time.
