Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

RT config files different instances

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


rgm at ast

Jul 14, 2012, 4:21 AM

Post #1 of 8 (742 views)
Permalink
RT config files different instances

Hello,

I have a a few different RT instances and I am running reports
remotely, see exampe code below.

At the moment I have all the passwords in each report script but I would
like to move the DB info and passwords to configuration files and specify
the config files as command line options using Getopt::Long.

I am considering using the perl module Config::Tiny to read
the configuration information. Are there any other suggestions?

e.g. should/can I uses RT's own configuration handler. If yes,
where is a good place to start? Thiscwould also mean less
extra Per modules needed. I will share the reporing scripts
when I have finished.

e.g this is what I do now:

RT::LoadConfig();

# set/change some Config values
if host=host1) {
RT->Config->Set( DatabaseType => 'mysql' );
RT->Config->Set( DatabaseHost => 'host1.ast.cam.ac.uk' );
RT->Config->Set( DatabaseName => 'rt3' );
RT->Config->Set( DatabaseUser => 'rgm');
RT->Config->Set( DatabasePassword => 'NotaPassword');
RT->Config->Set( LogDir => '/home/rgm/soft/rt/host1/log/' );
}

if (host=host2) { }

RT::Init();

r.


-------------------------------------------------------------------
Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
University of Cambridge | (switchboard) 1223-337548
Institute of Astronomy | (secretary) 1223-337516
Madingley Rd | FAX 1223-337523
Cambridge, CB3 OHA, UK. | mobile 7885-409019
Office: Hoyle 18 | home 1223-359770
-------------------------------------------------------------------
email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
richardgmcmahon [at] gmail | skype: richardgmcmahon
-------------------------------------------------------------------


ruslan.zakirov at gmail

Jul 14, 2012, 1:15 PM

Post #2 of 8 (693 views)
Permalink
Re: RT config files different instances [In reply to]

Even if you can make it work, there is no guaranty it will work acros
versions of RT. Do you use RT API for reporting?

Ruslan from phone.
14.07.2012 15:22 пользователь "Richard McMahon" <rgm [at] ast> написал:

> Hello,
>
> I have a a few different RT instances and I am running reports
> remotely, see exampe code below.
>
> At the moment I have all the passwords in each report script but I would
> like to move the DB info and passwords to configuration files and specify
> the config files as command line options using Getopt::Long.
>
> I am considering using the perl module Config::Tiny to read
> the configuration information. Are there any other suggestions?
>
> e.g. should/can I uses RT's own configuration handler. If yes,
> where is a good place to start? Thiscwould also mean less
> extra Per modules needed. I will share the reporing scripts
> when I have finished.
>
> e.g this is what I do now:
>
> RT::LoadConfig();
>
> # set/change some Config values
> if host=host1) {
> RT->Config->Set( DatabaseType => 'mysql' );
> RT->Config->Set( DatabaseHost => 'host1.ast.cam.ac.uk' );
> RT->Config->Set( DatabaseName => 'rt3' );
> RT->Config->Set( DatabaseUser => 'rgm');
> RT->Config->Set( DatabasePassword => 'NotaPassword');
> RT->Config->Set( LogDir => '/home/rgm/soft/rt/host1/log/' );
> }
>
> if (host=host2) { }
>
> RT::Init();
>
> r.
>
>
> ------------------------------**------------------------------**-------
> Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
> University of Cambridge | (switchboard) 1223-337548
> Institute of Astronomy | (secretary) 1223-337516
> Madingley Rd | FAX 1223-337523
> Cambridge, CB3 OHA, UK. | mobile 7885-409019
> Office: Hoyle 18 | home 1223-359770
> ------------------------------**------------------------------**-------
> email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
> richardgmcmahon [at] gmail | skype: richardgmcmahon
> ------------------------------**------------------------------**-------
>


rgm at ast

Jul 14, 2012, 3:14 PM

Post #3 of 8 (692 views)
Permalink
Re: RT config files different instances [In reply to]

Yes, I am using the API for reporting.

Can the API report the version of the local RT API being used and the RT
version that is running on the remote host?

r.


On Sat, 14 Jul 2012, Ruslan Zakirov wrote:

> Date: Sat, 14 Jul 2012 23:15:47 +0300
> From: Ruslan Zakirov <ruslan.zakirov [at] gmail>
> To: Richard McMahon <rgm [at] ast>
> Cc: rt-users [at] lists
> Subject: Re: [rt-users] RT config files different instances
>
>
> Even if you can make it work, there is no guaranty it will work acros
> versions of RT. Do you use RT API for reporting?
>
> Ruslan from phone.
>
> 14.07.2012 15:22 пользователь "Richard McMahon" <rgm [at] ast> написал:
> Hello,
>
> I have a a few different RT instances and I am running reports
> remotely, see exampe code below.
>
> At the moment I have all the passwords in each report script but
> I would like to move the DB info and passwords to configuration
> files and specify the config files as command line options using
> Getopt::Long.
>
> I am considering using the perl module Config::Tiny to read
> the configuration information. Are there any other suggestions?
>
> e.g. should/can I uses RT's own configuration handler. If yes,
> where is a good place to start? Thiscwould also mean less
> extra Per modules needed. I will share the reporing scripts
> when I have finished.
>
> e.g this is what I do now:
>
> RT::LoadConfig();
>
> # set/change some Config values
> if host=host1) {
>   RT->Config->Set( DatabaseType => 'mysql' );
>   RT->Config->Set( DatabaseHost => 'host1.ast.cam.ac.uk' );
>   RT->Config->Set( DatabaseName => 'rt3' );
>   RT->Config->Set( DatabaseUser => 'rgm');
>   RT->Config->Set( DatabasePassword => 'NotaPassword');
>   RT->Config->Set( LogDir => '/home/rgm/soft/rt/host1/log/' );
> }
>
> if (host=host2) { }
>
> RT::Init();
>
> r.
>
>
> -------------------------------------------------------------------
>  Dr. Richard G. McMahon    | Phone (office)    
> 44-(0)-1223-337519
>  University of Cambridge   |       (switchboard)      
> 1223-337548
>  Institute of Astronomy    |       (secretary)        
> 1223-337516
>  Madingley Rd              | FAX                      
> 1223-337523
>  Cambridge, CB3 OHA, UK.   | mobile                  
>  7885-409019
>  Office: Hoyle 18          | home                    
>  1223-359770
> -------------------------------------------------------------------
>  email: rgm [at] ast  | WWW:  
>  http://www.ast.cam.ac.uk/~rgm
>  richardgmcmahon [at] gmail | skype:              
>  richardgmcmahon
> -------------------------------------------------------------------
>
>
>

-------------------------------------------------------------------
Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
University of Cambridge | (switchboard) 1223-337548
Institute of Astronomy | (secretary) 1223-337516
Madingley Rd | FAX 1223-337523
Cambridge, CB3 OHA, UK. | mobile 7885-409019
Office: Hoyle 18 | home 1223-359770
-------------------------------------------------------------------
email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
richardgmcmahon [at] gmail | skype: richardgmcmahon
-------------------------------------------------------------------


ruslan.zakirov at gmail

Jul 15, 2012, 6:51 AM

Post #4 of 8 (677 views)
Permalink
Re: RT config files different instances [In reply to]

On Sun, Jul 15, 2012 at 1:14 AM, Richard McMahon <rgm [at] ast> wrote:
>
> Yes, I am using the API for reporting.
>
> Can the API report the version of the local RT API being used and the RT
> version that is running on the remote host?

No.

Problem here is that you need RT source code to match DB. You can not
use one codebase to talk to different DBs that have different versions.

You don't talk about REST interface, right?

> r.
> On Sat, 14 Jul 2012, Ruslan Zakirov wrote:
>> Date: Sat, 14 Jul 2012 23:15:47 +0300
>> From: Ruslan Zakirov <ruslan.zakirov [at] gmail>
>> To: Richard McMahon <rgm [at] ast>
>> Cc: rt-users [at] lists
>> Subject: Re: [rt-users] RT config files different instances
>>
>>
>>
>> Even if you can make it work, there is no guaranty it will work acros
>> versions of RT. Do you use RT API for reporting?
>>
>> Ruslan from phone.
>>
>> 14.07.2012 15:22 пользователь "Richard McMahon" <rgm [at] ast>
>> написал:
>> Hello,
>>
>> I have a a few different RT instances and I am running reports
>> remotely, see exampe code below.
>>
>> At the moment I have all the passwords in each report script but
>> I would like to move the DB info and passwords to configuration
>> files and specify the config files as command line options using
>> Getopt::Long.
>>
>> I am considering using the perl module Config::Tiny to read
>> the configuration information. Are there any other suggestions?
>>
>> e.g. should/can I uses RT's own configuration handler. If yes,
>> where is a good place to start? Thiscwould also mean less
>> extra Per modules needed. I will share the reporing scripts
>> when I have finished.
>>
>> e.g this is what I do now:
>>
>> RT::LoadConfig();
>>
>> # set/change some Config values
>> if host=host1) {
>> RT->Config->Set( DatabaseType => 'mysql' );
>> RT->Config->Set( DatabaseHost => 'host1.ast.cam.ac.uk' );
>> RT->Config->Set( DatabaseName => 'rt3' );
>> RT->Config->Set( DatabaseUser => 'rgm');
>> RT->Config->Set( DatabasePassword => 'NotaPassword');
>> RT->Config->Set( LogDir => '/home/rgm/soft/rt/host1/log/' );
>> }
>>
>> if (host=host2) { }
>>
>> RT::Init();
>>
>> r.
>>
>>
>> -------------------------------------------------------------------
>> Dr. Richard G. McMahon | Phone (office)
>> 44-(0)-1223-337519
>> University of Cambridge | (switchboard)
>> 1223-337548
>> Institute of Astronomy | (secretary)
>> 1223-337516
>> Madingley Rd | FAX
>> 1223-337523
>> Cambridge, CB3 OHA, UK. | mobile
>> 7885-409019
>> Office: Hoyle 18 | home
>> 1223-359770
>> -------------------------------------------------------------------
>> email: rgm [at] ast | WWW:
>> http://www.ast.cam.ac.uk/~rgm
>> richardgmcmahon [at] gmail | skype:
>> richardgmcmahon
>> -------------------------------------------------------------------
>>
>>
>>
>
> -------------------------------------------------------------------
> Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
> University of Cambridge | (switchboard) 1223-337548
> Institute of Astronomy | (secretary) 1223-337516
> Madingley Rd | FAX 1223-337523
> Cambridge, CB3 OHA, UK. | mobile 7885-409019
> Office: Hoyle 18 | home 1223-359770
> -------------------------------------------------------------------
> email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
> richardgmcmahon [at] gmail | skype: richardgmcmahon
> -------------------------------------------------------------------



--
Best regards, Ruslan.


rgm at ast

Jul 16, 2012, 2:57 AM

Post #5 of 8 (662 views)
Permalink
Re: RT config files different instances [In reply to]

OK, my current two RT instances are 3.8(production) and
4.05 (Development). The 3.8 system will move to 4.06 soon.

Use of REST is a possibility but would be mission creep at
the moment.

To avoid problems it would be useful to be able to get the RT version
numbers programmatically for:

(i) local RT API libraries

(ii) remote host [this could use REST] if the local API does not
support it.

r.


On Sun, 15 Jul 2012, Ruslan Zakirov wrote:

> Date: Sun, 15 Jul 2012 16:51:48 +0300
> From: Ruslan Zakirov <ruslan.zakirov [at] gmail>
> To: Richard McMahon <rgm [at] ast>
> Cc: rt-users [at] lists
> Subject: Re: [rt-users] RT config files different instances
>
> On Sun, Jul 15, 2012 at 1:14 AM, Richard McMahon <rgm [at] ast> wrote:
>>
>> Yes, I am using the API for reporting.
>>
>> Can the API report the version of the local RT API being used and the RT
>> version that is running on the remote host?
>
> No.
>
> Problem here is that you need RT source code to match DB. You can not
> use one codebase to talk to different DBs that have different versions.
>
> You don't talk about REST interface, right?
>
>> r.
>> On Sat, 14 Jul 2012, Ruslan Zakirov wrote:
>>> Date: Sat, 14 Jul 2012 23:15:47 +0300
>>> From: Ruslan Zakirov <ruslan.zakirov [at] gmail>
>>> To: Richard McMahon <rgm [at] ast>
>>> Cc: rt-users [at] lists
>>> Subject: Re: [rt-users] RT config files different instances
>>>
>>>
>>>
>>> Even if you can make it work, there is no guaranty it will work acros
>>> versions of RT. Do you use RT API for reporting?
>>>
>>> Ruslan from phone.
>>>
>>> 14.07.2012 15:22 пользователь "Richard McMahon" <rgm [at] ast>
>>> написал:
>>> Hello,
>>>
>>> I have a a few different RT instances and I am running reports
>>> remotely, see exampe code below.
>>>
>>> At the moment I have all the passwords in each report script but
>>> I would like to move the DB info and passwords to configuration
>>> files and specify the config files as command line options using
>>> Getopt::Long.
>>>
>>> I am considering using the perl module Config::Tiny to read
>>> the configuration information. Are there any other suggestions?
>>>
>>> e.g. should/can I uses RT's own configuration handler. If yes,
>>> where is a good place to start? Thiscwould also mean less
>>> extra Per modules needed. I will share the reporing scripts
>>> when I have finished.
>>>
>>> e.g this is what I do now:
>>>
>>> RT::LoadConfig();
>>>
>>> # set/change some Config values
>>> if host=host1) {
>>> RT->Config->Set( DatabaseType => 'mysql' );
>>> RT->Config->Set( DatabaseHost => 'host1.ast.cam.ac.uk' );
>>> RT->Config->Set( DatabaseName => 'rt3' );
>>> RT->Config->Set( DatabaseUser => 'rgm');
>>> RT->Config->Set( DatabasePassword => 'NotaPassword');
>>> RT->Config->Set( LogDir => '/home/rgm/soft/rt/host1/log/' );
>>> }
>>>
>>> if (host=host2) { }
>>>
>>> RT::Init();
>>>
>>> r.
>>>
>>>
>>> -------------------------------------------------------------------
>>> Dr. Richard G. McMahon | Phone (office)
>>> 44-(0)-1223-337519
>>> University of Cambridge | (switchboard)
>>> 1223-337548
>>> Institute of Astronomy | (secretary)
>>> 1223-337516
>>> Madingley Rd | FAX
>>> 1223-337523
>>> Cambridge, CB3 OHA, UK. | mobile
>>> 7885-409019
>>> Office: Hoyle 18 | home
>>> 1223-359770
>>> -------------------------------------------------------------------
>>> email: rgm [at] ast | WWW:
>>> http://www.ast.cam.ac.uk/~rgm
>>> richardgmcmahon [at] gmail | skype:
>>> richardgmcmahon
>>> -------------------------------------------------------------------
>>>
>>>
>>>
>>
>> -------------------------------------------------------------------
>> Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
>> University of Cambridge | (switchboard) 1223-337548
>> Institute of Astronomy | (secretary) 1223-337516
>> Madingley Rd | FAX 1223-337523
>> Cambridge, CB3 OHA, UK. | mobile 7885-409019
>> Office: Hoyle 18 | home 1223-359770
>> -------------------------------------------------------------------
>> email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
>> richardgmcmahon [at] gmail | skype: richardgmcmahon
>> -------------------------------------------------------------------
>
>
>
>

-------------------------------------------------------------------
Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
University of Cambridge | (switchboard) 1223-337548
Institute of Astronomy | (secretary) 1223-337516
Madingley Rd | FAX 1223-337523
Cambridge, CB3 OHA, UK. | mobile 7885-409019
Office: Hoyle 18 | home 1223-359770
-------------------------------------------------------------------
email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
richardgmcmahon [at] gmail | skype: richardgmcmahon
-------------------------------------------------------------------


ruslan.zakirov at gmail

Jul 19, 2012, 12:19 PM

Post #6 of 8 (631 views)
Permalink
Re: RT config files different instances [In reply to]

Hi,

Sorry for delay. Didn't know how to describe situation.

1) Don't use REST for anything except creating and replying to
tickets. REST needs complete rewrite.

2) Anything that does reporting via higher level than perl API will
suffer performance issues at some point.

3) You can write a perl program that talks to one set of RT libraries
at a moment.

4) You can write a program that can work with 3.8 API and 4.0 API.

5) Never use RT libraries that don't match DB.

On Mon, Jul 16, 2012 at 12:57 PM, Richard McMahon <rgm [at] ast> wrote:
>
> OK, my current two RT instances are 3.8(production) and
> 4.05 (Development). The 3.8 system will move to 4.06 soon.
>
> Use of REST is a possibility but would be mission creep at
> the moment.
>
> To avoid problems it would be useful to be able to get the RT version
> numbers programmatically for:
>
> (i) local RT API libraries
>
> (ii) remote host [this could use REST] if the local API does not
> support it.
>
> r.

--
Best regards, Ruslan.


rgm at ast

Jul 21, 2012, 8:47 AM

Post #7 of 8 (599 views)
Permalink
Re: RT config files different instances [In reply to]

OK, I will aim to use compatible RT API libraries. I can host more than
one version on the remote client if required.

It would be useful to be able to determine the version of RT running on
the client and server via the API. I can use REST to determine the
version of the RT on the remote version:

e.g. http://..../REST/1.0 returns

RT/3.8.HEAD 401 Credentials required

Is there a way to access/report the RT version library verion from
within Perl. In Python I would use something like:

print 'matplotlib.__version__: ', matplotlib.__version__

thanks

On Thu, 19 Jul 2012, Ruslan Zakirov wrote:

> Date: Thu, 19 Jul 2012 22:19:51 +0300
> From: Ruslan Zakirov <ruslan.zakirov [at] gmail>
> To: Richard McMahon <rgm [at] ast>
> Cc: rt-users [at] lists
> Subject: Re: [rt-users] RT config files different instances
>
> Hi,
>
> Sorry for delay. Didn't know how to describe situation.
>
> 1) Don't use REST for anything except creating and replying to
> tickets. REST needs complete rewrite.
>
> 2) Anything that does reporting via higher level than perl API will
> suffer performance issues at some point.
>
> 3) You can write a perl program that talks to one set of RT libraries
> at a moment.
>
> 4) You can write a program that can work with 3.8 API and 4.0 API.
>
> 5) Never use RT libraries that don't match DB.
>
> On Mon, Jul 16, 2012 at 12:57 PM, Richard McMahon <rgm [at] ast> wrote:
>>
>> OK, my current two RT instances are 3.8(production) and
>> 4.05 (Development). The 3.8 system will move to 4.06 soon.
>>
>> Use of REST is a possibility but would be mission creep at
>> the moment.
>>
>> To avoid problems it would be useful to be able to get the RT version
>> numbers programmatically for:
>>
>> (i) local RT API libraries
>>
>> (ii) remote host [this could use REST] if the local API does not
>> support it.
>>
>> r.
>
>

-------------------------------------------------------------------
Dr. Richard G. McMahon | Phone (office) 44-(0)-1223-337519
University of Cambridge | (switchboard) 1223-337548
Institute of Astronomy | (secretary) 1223-337516
Madingley Rd | FAX 1223-337523
Cambridge, CB3 OHA, UK. | mobile 7885-409019
Office: Hoyle 18 | home 1223-359770
-------------------------------------------------------------------
email: rgm [at] ast | WWW: http://www.ast.cam.ac.uk/~rgm
richardgmcmahon [at] gmail | skype: richardgmcmahon
-------------------------------------------------------------------


falcone at bestpractical

Jul 31, 2012, 9:04 AM

Post #8 of 8 (512 views)
Permalink
Re: RT config files different instances [In reply to]

On Sat, Jul 21, 2012 at 04:47:13PM +0100, Richard McMahon wrote:
>
> OK, I will aim to use compatible RT API libraries. I can host more
> than one version on the remote client if required.
>
> It would be useful to be able to determine the version of RT running
> on the client and server via the API. I can use REST to determine
> the
> version of the RT on the remote version:
>
> e.g. http://..../REST/1.0 returns
>
> RT/3.8.HEAD 401 Credentials required
>
> Is there a way to access/report the RT version library verion from
> within Perl. In Python I would use something like:
>
> print 'matplotlib.__version__: ', matplotlib.__version__

I'm running a dev version, but this gives you the idea:

$ perl -Ilib -MRT -le 'print $RT::VERSION'
4.0.6-249-g8dbb7c5


-kevin

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.