How to enumerate users

Hello,

we want to enumerate (regularly) all users existing in RT3.0.12 to
refresh the information (work phone, address, etc) from an LDAP server.
Obviously, a “/opt/rt3/bin/rt show user/1-9999” would do, but it would
be very resource intensive %-)

Is there a way to pull all users, one at a time?
The check on new data and update from the LDAP is not an issue here…
just getting the user list. We currently look at a RT::CLI solution.
Possibly a rt-crontool would do as well (if someone has an idea).

Best regards,

Ruediger Riediger

Dr. Ruediger Riediger Sun Microsystems GmbH
NSG - SunCERT Komturstr. 18a
mailto:Ruediger.Riediger@Sun.com D-12099 Berlin
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
PGP 2048RSA/0x2C5020E9 964C E189 0FF0 8882 2BAB 65E2 6912 1FF2

Ruediger Riediger wrote:

Hello,

we want to enumerate (regularly) all users existing in RT3.0.12 to
refresh the information (work phone, address, etc) from an LDAP server.
Obviously, a “/opt/rt3/bin/rt show user/1-9999” would do, but it would
be very resource intensive %-)

Is there a way to pull all users, one at a time?
As far as I understand your task, then you don’t want to pull info from RT.
You require CLI that allow you update users info. And script that
fetches info from LDAP and execute script that updates user record.

Small example that updates user info:


use RT::User;
my $u_obj = RT::User->new( $RT::SystemUser );
$u_obj->Load( ‘foo@example.com’ );
die “No user” unless( $u_obj->id );

$u_obj->Set( Field => ‘RealName’, Value => ‘Foo Z. Bar’ );

Ruslan U. Zakirov wrote:

we want to enumerate (regularly) all users existing in RT3.0.12 to
refresh the information (work phone, address, etc) from an LDAP server.
Obviously, a “/opt/rt3/bin/rt show user/1-9999” would do, but it would
be very resource intensive %-)

Is there a way to pull all users, one at a time?

As far as I understand your task, then you don’t want to pull info from RT.
You require CLI that allow you update users info. And script that
fetches info from LDAP and execute script that updates user record.

Small example that updates user info:


use RT::User;
my $u_obj = RT::User->new( $RT::SystemUser );
$u_obj->Load( ‘foo@example.com’ );
die “No user” unless( $u_obj->id );

$u_obj->Set( Field => ‘RealName’, Value => ‘Foo Z. Bar’ );

Close to it. How do we know which users to load? We do not want to go
over all what is in LDAP but rather each user in RT, like

for ($i=1; $i++; …)
{
$u_obj->Load( $i );
next unless ($u_obj->id)
}

The problem is: how to run through all users while skipping the gaps.
And as there are gaps, when to stop?

Best regards,

Ruediger Riediger

Dr. Ruediger Riediger Sun Microsystems GmbH
NSG - SunCERT Komturstr. 18a
mailto:Ruediger.Riediger@Sun.com D-12099 Berlin
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
PGP 2048RSA/0x2C5020E9 964C E189 0FF0 8882 2BAB 65E2 6912 1FF2

I’ve been playing around with RT 3.2.2 in preparation for
deploying it for a small group. One thing that appears
to be lacking (please correct me if I’m wrong) is a
RT at a glance management status view web page, on which a
support manager could see the X highest priority
tickets owned by all the people I manage, along
with all the X newest unowned tickets (like the
current home page has).

Is anyone working on such a thing or does anybody
have any thoughts about this?

Cordially,
Jon Forrest
Computer Resources Manager
Civil and Environmental Engineering Dept.
205 Davis Hall
Univ. of Calif., Berkeley
Berkeley, CA 94720-1710
510-642-0904
forrest@ce.berkeley.edu

I’ve been playing around with RT 3.2.2 in preparation for
deploying it for a small group. One thing that appears
to be lacking (please correct me if I’m wrong) is a
RT at a glance management status view web page, on which a
support manager could see the X highest priority
tickets owned by all the people I manage, along
with all the X newest unowned tickets (like the
current home page has).

Is anyone working on such a thing or does anybody
have any thoughts about this?

Build a query in the Query Builder and either save it in the saved
searches or just hang on to the bookmarkable link. This isn’t a wheel
in any particular need of reinvention.

Andy Harrison

I’ve been playing around with RT 3.2.2 in preparation for
deploying it for a small group. One thing that appears
to be lacking (please correct me if I’m wrong) is a
RT at a glance management status view web page, on which a
support manager could see the X highest priority
tickets owned by all the people I manage, along
with all the X newest unowned tickets (like the
current home page has).
Build a query in the Query Builder and either save it in the saved
searches or just hang on to the bookmarkable link. This isn’t a wheel
in any particular need of reinvention.

Alternatively you could build a new module for the home page to give
this info (though this will appear for anyone).

I created a new module based on one of the existing ones which shows
“For each queue you’re an AdminCc on, show the top n priority tickets”
which is a godsend for the way we divvy up responsibilities. It only
took about an hour.

Cheers
Carl

   Carl Vincent              http://www.netskills.ac.uk/ (URL)
   Information Systems Manager           0191 222 5003 (voice)
   NETSKILLS - Quality Internet Training  0191 222 5001  (fax)

Sharing what we came up with :slight_smile:

The attached code should be self-explaining. It should be run from cron,
e.g. once per day, and will import information which has changed in
the LDAP since the user creation. Note that user creation is part of
the original LDAP Overlay for RT3, see

http://wiki.bestpractical.com/index.cgi?LdapOverlay

Best regards,

Ruediger Riediger

Dr. Ruediger Riediger Sun Microsystems GmbH
NSG - SunCERT Komturstr. 18a
mailto:Ruediger.Riediger@Sun.com D-12099 Berlin
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
PGP 2048RSA/0x2C5020E9 964C E189 0FF0 8882 2BAB 65E2 6912 1FF2

rt_ldap2user.pl (5.96 KB)