<div dir="ltr">Jim thank you so much for sending these.  I really appreciate it.  I'll respond back on resolution to ensure anyone else who may want this has the info.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 28, 2016 at 10:44 AM Jim Brandt <<a href="mailto:jbrandt@bestpractical.com">jbrandt@bestpractical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Matt,<br>
    <br>
    It would probably be easier to put all of the DataDog code right in
    an RT Action module rather than making a system call. If you take a
    look at the docs for this extension, it describes how to do that,
    where to put the new action files, etc.:<br>
    <br>
    <a href="https://metacpan.org/pod/RT::Extension::AdminConditionsAndActions" target="_blank">https://metacpan.org/pod/RT::Extension::AdminConditionsAndActions</a><br>
    <br>
    And it's worth installing that extension if you'll be working with
    custom conditions and actions because it makes it much easier to
    manage them.<br>
    <br>
    And if you're thinking about releasing it as an extension, this will
    get you started:<br>
    <br>
    <a href="https://bestpractical.com/docs/rt/4.2/writing_extensions.html" target="_blank">https://bestpractical.com/docs/rt/4.2/writing_extensions.html</a><br>
    <br>
    Good luck.<br>
    Jim</div><div bgcolor="#FFFFFF" text="#000000"><br>
    <br>
    <div>On 1/28/16 1:26 PM, Matt Wells wrote:<br>
    </div>
    </div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite">
      <div dir="ltr">Hi all, so I have some things work on this.  I'm
        wondering if anyone can help me with the last part.  I really
        can't thank you guys enough for any help you can give.
        <div><br>
        </div>
        <div>So I have a custom scrip that's working if I run it maually
          but getting it through RT is causing issues.  So this is what
          I've got.<br>
        </div>
        <div>
          <div>Condition: On Create</div>
          <div>Action: User defined</div>
          <div>Template: Blank</div>
          <div><br>
          </div>
          <div>Custom condition:<span style="white-space:pre-wrap">       </span></div>
          <div>return 0;</div>
          <div><br>
          </div>
          <div>Custom action preparation code:<span style="white-space:pre-wrap"> </span></div>
          <div>my $ticket = $self->TicketObj;</div>
          <div>my $subject = $Tickets->Subject;</div>
          <div>my $name = $requestor;</div>
          <div>my $queue = $queue</div>
          <div>system('/usr/bin/perl
            /opt/rt4/lib/RT/Action/DataDogEvent.pm $name $ticket
            "$subject" $ queue');</div>
          <div>return 1;</div>
          <div><br>
          </div>
          <div>Custom action commit code:<span style="white-space:pre-wrap">      </span></div>
          <div>return 0;</div>
        </div>
        <div><br>
        </div>
        <div>The Script that's getting called.  </div>
        <div>/opt/rt4/lib/RT/Action/DataDogEvent.pm<br>
        </div>
        <div>
          <div>#!/usr/bin/perl</div>
          <div><br>
          </div>
          <div>use strict;</div>
          <div>use warnings;</div>
          <div><br>
          </div>
          <div>use WebService::DataDog;</div>
          <div>use Try::Tiny;</div>
          <div>use Data::Dumper;</div>
          <div><br>
          </div>
          <div>my $datadog = WebService::DataDog->new(</div>
          <div>        api_key         => '123apikey',</div>
          <div>        application_key => '123appkey',</div>
          <div>        verbose         => 0, # Enable this for
            debugging output</div>
          <div>#<span style="white-space:pre-wrap">       </span>verbose  
                  => 1,</div>
          <div>);</div>
          <div><br>
          </div>
          <div>my $event = $datadog->build('Event');</div>
          <div>my $event_list;</div>
          <div><br>
          </div>
          <div>my $name   = $ARGV[0];</div>
          <div>my $ticket = $ARGV[1];</div>
          <div>my $subject = $ARGV[2];</div>
          <div>my $queue = $ARGV[3];</div>
          <div><br>
          </div>
          <div># Post a new event to stream</div>
          <div>$event->create(</div>
          <div><span style="white-space:pre-wrap">        </span>title
            => "$name - $ticket",</div>
          <div><span style="white-space:pre-wrap">        </span>text
             => "$subject",</div>
          <div><span style="white-space:pre-wrap">        </span>tags =>
            ['NOCRT', "$queue"],</div>
          <div><br>
          </div>
          <div>);</div>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Jan 25, 2016 at 1:32 PM, Matt
          Wells <span dir="ltr"><<a href="mailto:matt.wells@mosaic451.com" target="_blank">matt.wells@mosaic451.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>Has anyone ever attempted to integrate RT with
                    DataDog and it's web api or configurations?</div>
                  <div>I've seen some integrations with
                    "SendNagiosAlert" but was wondering if anyone had
                    done something similar with DataDog?  I'm starting
                    to play with it now using this -</div>
                  <div><a href="http://search.cpan.org/%7Ejpinkham/WebService-DataDog-0.9.0/lib/WebService/DataDog.pm" target="_blank">http://search.cpan.org/~jpinkham/WebService-DataDog-0.9.0/lib/WebService/DataDog.pm</a><br>
                  </div>
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div>
          <div dir="ltr">
            <div>Matt Wells<br>
              Chief Systems Architect<br>
              <span style="font-size:12.8000001907349px">RHCA, </span>RHCVA
              - #110-000-353<br>
              (702) 808-0424<br>
              <a href="mailto:matt.wells@mosaic451.com" target="_blank">matt.wells@mosaic451.com</a><br>
               Las Vegas | Phoenix | Portland Mosaic451.com <br>
              CONFIDENTIALITY NOTICE: This transmittal is a confidential
              communication or may otherwise be privileged. If you are
              not intended recipient, you are hereby notified that you
              have received this transmittal in error and that any
              review, dissemination, distribution or copying of this
              transmittal is strictly prohibited. If you have received
              this communication in error, please notify this office,
              and immediately delete this message and all its
              attachments, if any.<br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </blockquote></div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><pre>
---------
RT 4.4 and RTIR Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)
* Hamburg Germany — March 14 & 15, 2016</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><div dir="ltr">-- <br></div><div dir="ltr"><span>Matt Wells</span><br><span>Chief Systems Architect</span><br><span>RHCA, </span><span>RHCVA - #110-000-353</span><br><span>(702) 808-0424</span><br><a>matt.wells@mosaic451.com</a><br><span> Las Vegas | Phoenix | Portland Mosaic451.com </span><br><span>CONFIDENTIALITY NOTICE: This transmittal is a confidential communication or may otherwise be privileged. If you are not intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you have received this communication in error, please notify this office, and immediately delete this message and all its attachments, if any.</span><br></div>