Chapter 5. Administrative Tasks

Day-to-day administration of an RT instance is pretty minimal. Other than the initial installation, setup, and occasional configuration tweaks, administration generally falls under a few basic areas: creating new users, modifying existing users, and backups.

Now that you have an RT server running, it’s time to configure and customize it for your organization. Chapter 7 shows some example configurations, but for now, we’ll help you get up to speed with a basic RT configuration.

First, you’ll need to create a few users. Once that’s taken care of, you’ll create a queue for your project and grant your users rights to work with that queue.

Every person that interacts with RT has a corresponding user object. This object is loaded when the person accesses RT, whether through the web, email, or rt.

To create a new user, load up RT’s web interface and click on Configuration, Users, and then New user. Figure 5-1 shows the new user page. To update an existing user (for example, one that RT created automatically from an incoming email), click Configuration, Users, and then search for the user’s email address, names, or user id.

The only required attribute is Name, which RT uses as the username. If you want RT to be able to send email to your users, it’s worth filling in the Email Address and Real Name fields. If your users will be logging into RT, you also should fill in the Password field.

Privileged users have access to RT’s full web interface and can be granted rights directly. Unprivileged users only get access to RT’s self-service interface. As of RT 3.4.2, only privileged users can be added as group member in RT, but that will change in the future.

When RT creates a user, it creates an unprivileged user by default. To make your user privileged, check the box Let this user be granted rights.

If you ever need to cut off someone’s access to RT, uncheck the box Let this user access RT. This will make sure the user can’t log in to RT, but it does not fully delete the user. RT won’t let you delete users because that would erase everything that user had done, and a large part of the point of a system like RT is that you don’t lose history like that.

RT has a built-in group management system to make it easy to manage your users’ rights and responsibilities. You can grant rights to groups and make them queue and ticket watchers. Using RT’s Saved search system, it’s also possible to let group members share saved searches among themselves. You’re not required to use groups when managing RT. But it’s a lot easier to pop somebody into a group when they join your team and yank them out if they leave than go through 10 different queues looking to see if you’ve properly yanked any rights they once had.

You’ll want to set up a queue for each new department or long-lived project that you track in RT. Like users and groups, queues never go away, so you don’t want to create too many. Create a queue each time you have a set of tasks or requests that will be handled by a separate group of people who track their own special metadata or have different privacy requirements than your existing queues.

If you’ve been following along, the instructions for creating a queue are going to look rather familiar. Click Configuration, then Queues, and then New queue. Figure 5-3 shows the new queue page.

The Queue Name is the primary way that you’ll see the queue in the web interface and also from the mail gateway and some scrips. While you can use any name you want, it’s easiest to stick with names that don’t contain apostrophes, slashes, and other characters that might need special escaping. The Reply Address and Comment Address fields determine what RT will stick in the return address of outgoing response and comment emails. If you leave them blank, they default to the systemwide settings in your configuration file. RT also lets you set a default initial priority for tickets in the queue, as well as a final priority that only kicks in if you use the RT escalation tool.[10] If you fill in the Requests should be due in _ _ days field, RT will automatically assign a due date that many days in the future for your tickets.

Don’t forget to set up RT’s incoming mail gateway for your new queues. See Chapter 2 for instructions on how to do that.

RT lets you define custom fields that apply to tickets, ticket updates, users, or groups. People mainly use custom fields to track additional site-specific metadata. We’ve seen them used for simple things, such as the version number of a software package where a bug was found, and more complex things, such as whether someone enquiring about renting a vacation home needed a place that accepted pets.

As of this writing, RT supports five different sorts of custom fields: Select to pick from list, Freeform to type a line of text, Text to type a large block of text, Wikitext to hold multi-line blocks of wikitext, Binary to upload a file, and Image to upload an image. For each of these types except Text, you can pick whether you want your users to be able to enter one or many values. In the near future, we expect to add additional field types, as well as validated and mandatory fields.

Most days, you won’t need to think about RT management. Sometimes, you’ll need to reset a user’s password, add a queue, or update someone’s permissions, but RT generally takes care of itself. In this section, we’ll show you how to take care of a few of the most common day-to-day tasks you’ll encounter.

RT logs information about each message it sends out, as well as each message it considers sending out. All outgoing mail about a given ticket update is sent by a scrip. Each scrip evaluates some sort of condition, such as Is this a new ticket being created? or Is this a private comment? If the answer to the question is Yes, then RT moves on to whichever action you’ve associated with that scrip. It might be an action such as notify the requestor or notify the owner. RT then sets up an email message using the template you’ve defined for the scrip and checks to make sure that it’s actually being sent to someone. RT logs this process using its standard logging framework. Log messages about scrip-generated email are keyed by the outgoing message’s Message-Id header. You can use that identifier to trace a message RT sends as it makes its way across the Internet from your RT server to the recipient’s local email server. The example below shows an autoreply being sent out to .

 Jul 4 22:15:53 pallas RT: <rt-3.2.HEAD-5813-28448-22.1.5718764250061@example.com>
#5813/28448 - Scrip 22
 Jul 4 22:15:53 pallas RT: <rt-3.2.HEAD-5813-28448-22.1.5718764250061@example.com>
sent To: jesse@example.com Cc: Bcc:

Let’s take a look at these log messages in a bit more detail. The first message gives us a heads-up that RT is considering sending some sort of email. In this case, scrip 22 sends an autoreply to the ticket’s creator when a ticket is created. This scrip is acting on transaction 28448 on ticket 5813. The second message tells us that RT has sent out this email to just one person, . If RT had decided to scrap the email, we’d see a different second message:

 Jul 4 22:15:53 pallas RT: <rt-3.2.HEAD-5813-28448-22.1.5718764250061@example.com>
No recipients found. Not sending

This usually means that you have a scrip set up to notify a ticket’s Owner or AdminCc or manually entered Cc or Bcc recipients, but there weren’t any.

RT doesn’t store anything important about your users, groups, tickets, or queues directly on your filesystem. All the data you need to worry about on a day-to-day basis lives inside the database you’ve set up for RT.

If you’re already backing up your MySQL, PostgreSQL, or Oracle server, you can skip down to Backing up the RT Application below.

If you’re still with us, that probably means you’re one of the silent majority of users who doesn’t yet backup your data, because you haven’t yet suffered catastropic data-loss. Backing up RT is quick and easy. All you need to do is take a snapshot of your database and spool it out to disk as a series of SQL statements that you can run later if you need to recreate your database.

MySQL

MySQL’s mysqldump command is a very convenient way to backup any MySQL database. It exports the contents of the database as a series of CREATE TABLE and INSERT statements, which then can be replayed to recreate a database. This method is slower than a disk-based byte-by-byte copy, but you are guaranteed to have a usable dump that can be used to recreate your database with minimal effort.

    mysqldump --opt --add-drop-table --single-transaction \
    -u rt_user -prt_pass -h databasehost rt3 > rt3-mysql-backup

rt_user, rt_pass, and rt_hostname should match the user, password, and hostname in your RT_Config.pm or RT_SiteConfig.pm.

PostgreSQL

pg_dump lets you dump out a live postgres database, including all schema and content. All of the previous comments about MySQL apply here, too.

    pg_dump --clean --blobs --format=C -U rt_user rt3 > rt3-postgres-backup
Oracle

If you’re running Oracle, it probably means you have a DBA. Take your DBA out to lunch, and discuss backing up your RT database. It’s a business expense and a great way to ensure his cooperation if you ever need your RT database restored at 2 a.m.

SQLite

SQLite uses a single file as its entire database. To be sure your database is consistent, stop your RT daemon, copy the database file to your backup media, and start RT again. This should be automated with cron, and done regularly. SQLite’s one file makes backups convenient. For example, you can use a source control system such as Subversion or CVS (in binary mode) to manage the file.

The RT application itself is stored on disk. Certain cache files get written out at runtime, but they’re not important to keep in the event of a catastrophe. If you’ve just installed RT from the source distribution and haven’t customized any of the source files or web templates, you can get by without backing up the RT application. Just make sure you hang onto a copy of the original source files and reinstall RT when you need to. If you’ve made any changes to RT’s configuration files, libraries, or web templates, you should keep backups of your RT installation. There isn’t any danger to backing up RT while it’s accepting tickets.

The most important file to back up is RT_SiteConfig.pm, since this the only file you are guaranteed to have changed. You can restore an RT instance using only RT_SiteConfig.pm and a database dump if needed.

When you back up the RT application and libraries, be sure that you have a backup of your webserver, database server, Perl installation, and other similar things on which RT depends. If you plan on making extensive changes to your RT instance, you should consider storing RT’s libraries and document root in a local source control repository. CVS’s vendor import facility was designed specifically to handle this situation (indeed, CVS originated as a way to track local modifications to vendor distributed source code), and other source control systems have analogous functionality.

The worst has happened. Your RT database server went up in a big ball of flames about 20 minutes ago. And your users are already clamoring for you to replace the server and let them get on with their work.

To get RT up and running after a crash, restore your RT application from your regular system backups. If that’s not an option, start with a brand new, fresh installation of the RT version you were running. Make sure RT’s configuration file has the same values it had before your crash. It’s particularly important that you get the $rtname and $Organization variables right, or RT won’t work properly.



[10] Run perldoc /opt/rt3/bin/rt-crontool for more information about the escalation tool.