RT Install : t/heuristic……FAILED test 6

Installing RT on Debian today I got into a bit of a CPAN dependacy loop with the make fixdeps tool :(  I eventually tracked it down to the URI module.

Basically the URI module fails to install because of :

t/heuristic……FAILED test 6

On doing some digging this was to do with checking correct name resolution and looking for a picture of a camel on the perl site (you can’t make this stuff up 🙂 ).

At the moment something is a bit screwy and this test is currently failing but it is not a big issue for correct operation.  The simple work around is to attempt to install it (  cpan URI ) wait for it to barf and then pop into /etc/resolv.conf comment out your nameservers,  rerun cpan URI and it will install correctly (remember to uncomment your name servers again in resolv.conf! 🙂

Now to get the rest of it up again 🙂

Oh BTW I installed XML::RSS and DBD::mysql via apt-get in the end 🙂

Posted in RT

RT Command Line adding users

A while a go I needed to add a whole raft of users (about 400 or so 🙂 ) to our work RT system. Doing this manually had little appeal so I was looking for a scriptable way of doing it.

I found a script on the wiki ( wiki.bestpractical.com ) but it only supported populating RT from /etc/passwd entires. So close and yet… so with a pointer or two from Bunty, my handy online Perl guru friend 🙂 I managed to use the existing script and bodge it to allow command line arguements 🙂

#!/usr/bin/perl -w
# rtadduser: add a local user to RT
# David Maze
# $Id$
# Poorly modified by Tig to accept commandline arguments
# Known issues, will silently fail if a user already exists

push @INC,"/usr/share/request-tracker3.6/lib/";
use lib "/usr/uns/lib";
use strict;
use English;
use RT::Interface::CLI qw(CleanEnv);
use RT::User;
use Getopt::Long;

my ($user, $passwd, $email);

GetOptions (
"user=s" => \$user,
"email=s" => \$email,
"passwd=s" => \$passwd


print("Creating user with the following variables\n");
print("user : $user\n");
print("e-mail : $email\n");
print("password : $passwd\n");

my $UserObj = new RT::User(RT::SystemUser);
$UserObj->Create(Name => $user,
EmailAddress => "$email",
Privileged => 1,
Password => $passwd

print("If there was no error it possibly worked!\n");

To use this you will need Getopt::Long installed, usage is :

perl rtadduser -user=username -email=user@foo.com -passwd=secretpassword

Oh and you will need to poke line 10 (the one with the path to RT.pm) for your distro.

I will put this onto the wiki soon, just needed to dump it somewhere indexable before I forget about it 🙂