HowTo or FAQ on creating scrips?

Hi,

I’ve seen a number of people asking how to create new Scrips, new
Actions, etc, and there’s been various mentions of putting the perl
module in the right place, and then modifying the database accordingly,
but try as I might, I haven’t yet seen a FAQ or HowTo on this (or, for
that matter, an answer…)

I’ve trawled through the archives, but haven’t seen anything jump out at
me. If someone has a reference to the steps one needs to go through to
add any of the add-ons, or our own Scrips/Actions/Conditions, it would
be most handy.

Thanks,

Scott

I’ve seen a number of people asking how to create new Scrips, new
Actions, etc, and there’s been various mentions of putting the perl
module in the right place, and then modifying the database accordingly,
but try as I might, I haven’t yet seen a FAQ or HowTo on this (or, for
that matter, an answer…)

‘You put the perl module in the right place, and update the database
accordingly’.

Theres a fair bit of hints and tips over in rt-devel regarding various
Scrips. The things you need are:

reading of man pages perlboot, perltoot, perltootc, perlobj,
perlbot, perlmod, perlmodlib, perlmodinstall.  (Go read them,
really, they explain a lot)

Reading of the RT::Condition::Generic and RT::Action::Generic
modules (lib/RT/Condition/Generic.pm and lib/RT/Action/Generic.pm)

Understanding what is the 'right' place for the modules:

	ScripConditions go in lib/RT/Condition/
	ScripActions go in lib/RT/Action/

Understanding how ScripConditions and ScripActions are loaded:

	The SQL tables ScripConditions and ScripActions define
	an 'ExecModule' which is used as the RT::Condition::blah
	or RT::Action::blah 'require'd in
	lib/RT/ScripCondition.pm's LoadCondition() and
	lib/RT/ScripAction.pm's LoadAction() methods.

Understanding how to insert ScripConditions and ScripActions into
the database:

	Copy someone else's 'insert_condition_blah.pl' or
	'insert_action_blah.pl', see
	http://www.fsck.com/pub/rt/contrib/2.0, and change as
	appropriate.

I’ve trawled through the archives, but haven’t seen anything jump out at
me. If someone has a reference to the steps one needs to go through to
add any of the add-ons, or our own Scrips/Actions/Conditions, it would
be most handy.

The above is a quick list. If you like, I can do up a quick (but in
detail) commentary on steps need to create your own
Scrip{Condition,Action} and put it into place. ( I’ve got something else
underway for work, so I can provide a walk-thru for that ).

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

The above is a quick list. If you like, I can do up a quick (but in
detail) commentary on steps need to create your own
Scrip{Condition,Action} and put it into place. ( I’ve got something else
underway for work, so I can provide a walk-thru for that ).

I would appreciate seeing something like this, if you’ve got the time to
post it.

Thanks.

Dave Hull
Senior Information Technology Analyst
The University of Kansas
voice: (785) 864-0403 || (785) 864-5621
fax: (785) 864-0485
http://insipid.cc.ukans.edu/dphull

The above is a quick list. If you like, I can do up a quick (but in
detail) commentary on steps need to create your own
Scrip{Condition,Action} and put it into place. ( I’ve got something else
underway for work, so I can provide a walk-thru for that ).

I would appreciate seeing something like this, if you’ve got the time to
post it.

I have some debugging work to do on the ScripCondition to make sure it
works as intended, but I guess it will be available tomorrow. Note that
perl isn’t really my field of expertise.

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations