[rt-users] Creating my own Scrip conditions

Kenneth Crocker KFCrocker at lbl.gov
Mon Oct 20 15:50:58 EDT 2008


Richard,


	I'm not sure I understand WHY you are creating new conditions. If you 
are trying to create your own scrips for non-default situations, I would 
recommend setting the Condition to "User-defined" and coding the correct 
perl for that condition. I do not understand why you would want top mess 
around with the code in the directories. Is there some condition you 
need to look for that is not codable in perl?


Kenn
LBNL

On 10/20/2008 8:25 AM, Richard Hartmann wrote:
> Hi all,
> 
> I have created a lib/RT/Condition/ZabbixEventStatusChange.pm which
> contains the following (pruned down to the relevant part):
> 
> sub IsApplicable {
>     my $self = shift;
>     if ($self->TransactionObj->Field =~ /zabbix_event_status/) {
>     return(1);
>     }
>     else {
>     return(undef);
>     }
> }
> 
> Also, I added
> 
>     {
> 
>       Name                 => 'On zabbix_event_status Change',
>               # loc
>       Description          => 'Whenever a ticket\'s
> zabbix_event_status changes',    # loc
>       ApplicableTransTypes => 'Set',
>       ExecModule           => 'ZabbixEventStatusChange',
>     },
> 
> to @ScripConditions in etc/initialdata .
> 
> I have four questions regarding this:
> 
> 1) Is the this the correct thing to do? If not, what is the correct
> approach? The condition does not show up in RT, even after an Apache
> restart which included killing the mason cache, so I probably did
> something wrong.
> 
> 2) Is =~ /foo/ the correct thing to do, here? I decided to play it save
> and not match too narrowly, atm.
> 
> 3) What happens if a user sets his locale to, say, french, for which I
> did not provide a translation. Will RT fall back gracefully?
> 
> 4) Can I overlay .po files? I did not even try as I suspect that will
> not work, anyway.
> 
> 
> All feedback extremely appreciated. RT fits our needs better and better,
> I just need to iron out the last few things, including this one :)
> 
> 
> Richard
> 
> 
> PS: If someone can tell me how to merge tickets from within the scrip I
> am writing, that would be awesome. Else, I will just figure it out,
> myself :)
> 
> PPS: The goal is to merge all tickets our Zabbix instances create to
> inform us of trigger changing to OFF into the tickets which set the
> initial ON for the tuple of zabbix instance & event id. If anyone needs
> such a thing for themselves, I will share, gladly.
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 




More information about the rt-users mailing list