This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Integration with Remedy

Does anyone use the Remedy Web Services as the interface with Orion? If so, what is the configuration setup?

  • Were you ever able to figure out how to do this?  I have this very need.  I was provided with the Remedy WSDL, but I need to figure out how to call it when one of my switches goes down to create a ticket.

    If anyone has any ideas on this, it would be greatly appreciated.

     

     

    Thanks.

  • First start with a WSDL / SOAP test tool. I like the following:

    NOTE: the WSDL is specific to our implementation. Change it to match yours.
    NOTE: the parameters are specific to our implementation. Change it to match yours.
    NOTE: I only fill in the mandatory fields to get a ticket cut.

    Here is a php test script I used to work with the WSDL exposed by our Remedy support staff.

     

    Kinda crude and brute force, but it worked.

    <?php

    $myargs = getArgs($_SERVER['argv']);

    foreach (array('u','p','g','c','o','f','l','s') as $arg) {
        if (!isset($myargs[$arg])) {
                echo "usage $argv[0] -u 'username' -p 'userpassword' -g 'group name as shown in ars' -c 'opcat1:opcat2:opcat3' -o 'prodcat1:prodcat2:prodcat3' -f 'firstname' -l 'lastname' -s 'summary field text'\n";
                exit;
        }
    }
    $opcats = split(":",$myargs['c']); print_r($opcats);
    $prodcats = split(":",$myargs['o']); print_r($prodcats);

    $params->Assigned_Group=$myargs['g'];
    $params->Assigned_Group_Shift_Name='';
    $params->Assigned_Support_Company='Liquids Pipelines';
    $params->Assigned_Support_Organization='Liquids Pipelines';
    $params->Assignee='';
    $params->Categorization_Tier_1=$opcats[0];
    $params->Categorization_Tier_2=$opcats[1];
    $params->Categorization_Tier_3=$opcats[2];
    $params->CI_Name='';
    $params->Closure_Manufacturer='';
    $params->Closure_Product_Category_Tier1='';
    $params->Closure_Product_Category_Tier2='';
    $params->Closure_Product_Category_Tier3='';
    $params->Closure_Product_Model_Version='';
    $params->Closure_Product_Name='';
    $params->Department='';
    $params->First_Name=$myargs['f'];
    $params->Impact='4-Minor/Localized';
    $params->Last_Name=$myargs['l'];
    $params->Lookup_Keyword='';
    $params->Manufacturer='';
    $params->Product_Categorization_Tier_1=$prodcats[0];
    $params->Product_Categorization_Tier_2=$prodcats[1];
    $params->Product_Categorization_Tier_3=$prodcats[2];
    $params->Product_Model_Version='';
    $params->Product_Name='';
    $params->Reported_Source='Direct Input';
    $params->Resolution='';
    $params->Resolution_Category_Tier_1='';
    $params->Resolution_Category_Tier_2='';
    $params->Resolution_Category_Tier_3='';
    $params->Service_Type='User Service Request';
    $params->Status='New';
    $params->Action='CREATE';
    $params->Create_Request='Yes';
    $params->Summary=$myargs['s'];
    $params->Notes='';
    $params->Urgency='4-Low';
    $params->Work_Info_Summary='';
    $params->Work_Info_Notes='';
    $params->Work_Info_Type='----- Customer Inbound -----';
    $params->Work_Info_Date='';
    $params->Work_Info_Source='Email';
    $params->Work_Info_Locked='Yes';
    $params->Work_Info_View_Access='Internal';
    $params->Middle_Initial='';

    //test
    //$ars = new SoapClient('hostname:8080/.../HPD_IncidentInterface_Create_WS');

    //dev
    //$ars = new SoapClient('hostname:8080/.../HPD_IncidentInterface_Create_WS');

    // prod
    $ars = new SoapClient('hostname:8080/.../HPD_IncidentInterface_Create_WS');

    $auth->userName=$myargs['u'];
    $auth->password=$myargs['p'];
    $authvalues = new SoapVar($auth, SOAP_ENC_OBJECT);
    $header =  new SoapHeader('name_space', "AuthenticationInfo", $authvalues, false);

    $ars->__setSoapHeaders(array($header));

    $result = $ars->HelpDesk_Submit_Service($params);
    var_dump($result);

    function getArgs($args) {
        $out = array();
        $last_arg = null;
        for($i = 1, $il = sizeof($args); $i < $il; $i++) {
            if( (bool)preg_match("/^--(.+)/", $args[$i], $match) ) {
                $parts = explode("=", $match[1]);
                $key = preg_replace("/[^a-z0-9]+/", "", $parts[0]);
                if(isset($parts[1])) {
                    $out[$key] = $parts[1];
                } else {
                    $out[$key] = true;
                }
                $last_arg = $key;
        } else if( (bool)preg_match("/^-([a-zA-Z0-9]+)/", $args[$i], $match) ) {
            for( $j = 0, $jl = strlen($match[1]); $j < $jl; $j++ ) {
                $key = $match[1]{$j};
                $out[$key] = true;
            }
            $last_arg = $key;
        } else if($last_arg !== null) {
            $out[$last_arg] = $args[$i];
        }
        }
        return $out;
    }

    ?>

  • Thanks for that info.  I have been playing with soapUI to get all the fields correct for creating a ticket, so I know all the fields I need now.

     

    How are you calling this PHP from Solarwinds?  Do you have PHP installed on your Solarwinds server?

     

     

    Thanks.

  • How are you calling this PHP from Solarwinds?  Do you have PHP installed on your Solarwinds server?

     

    Yes, I've installed PHP 5.x on the server and use the CLI interface.

     

    To call it, I do alert action of "run an external program" like this:

     

    C:\Program Files (x86)\PHP\TelAlert\php.exe c:\remedy.php  -u username -p password -g "Monitoring" -c Request:Service:Create -o "Software:IT Software:Monitoring" -f firstname -l lastname -s "cmdline soap testing from Orion"

  • Thanks for that info. That helps out.  Is this your entire code?  It seems maybe it is missing an object definition for "$params."  Or should $params be an array using => instead of ->?  Maybe I am just completely missing something.

     

    Thanks.

  • php doesn't require variable definition before use unless you do something like a "use strict". I don't do that.

    You are right that $params is an array. If there was a statement @ the top that said $params = array(); that would make it more clear.

    I'm lazy and you code in a different language (and probably aren't lazy!)

  • Not a problem.  I think I pretty much have it.  One more question, what is HelpDesk_Submit_Service()?  Is that something you have defined or is that one of the functions from your Remedy?  In my SOAP client, I use OpCreate to create a ticket.  I tried just changing HelpDesk_Submit_Service() with OpCreate(), but I get an error that "CLI has stopped working."

    Also, what are you using for 'namespace' in your SoapHeader() call?  That may be my problem.  Is this the same URL you are using when creating a new SoapClient()?

     

    Thanks for your help on this.

  • HelpDesk_Submit_Service() is the SOAP function that is exposed in the WSDL that the remedy support people setup. They can name it whatever they want. In my case they named it the same as a Remedy workflow function they use.

     

    NOTE: the exposed Remedy function can only be used for SUBMITTING a ticket (in my case).  The remedy people need to expose another WSDL so I can update an existing ticket or close a ticket.

     

    If you open the WSDL with something like SOAPSonar, you will see something like this. When you fill in the fields as required by Remedy and whack the button circled in red, the SOAP request is set back to the server.

     

    In my case it will invoke a serverside SOAP function named HelpDesk_Submit_Service()

  • Excellent.  I loaded up that tool to get some more information.  Unfortunately we are using https, which is not supported in the Personal Edition.  However, I am using soapUI, and I am able to successfully submit a request and create a ticket.  When I use the PHP code from the command line, however I get "CLI has stopped working" (see below).  Most of the code works, as I am printing out my arrays, but it seems to be the call to OpCreate in my case (HelpDesk_Submit_Service) in your case.

    1.  What do you have for 'nameservice'  when creating your new SoapHeader() or where can I find this in SOAPSonar (I can view, just not submit anything)?

    2.  Any ideas what might be causing this to crash like it is?

     

    Thanks for your patience and help.  I think I am almost there!

  • I usually run it from a dos box so I can see the output. I'm not sure if that makes a difference.

     

    Also do a "php -m" and make sure the "soap" module is in your installation

     

    I also have the following pear modules installed:

     

    C:\Program Files (x86)\PHP>pear list
    INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
    =========================================
    PACKAGE          VERSION STATE
    Archive_Tar      1.3.3   stable
    Console_Getopt   1.2.3   stable
    PEAR             1.9.0   stable
    Structures_Graph 1.0.2   stable
    XML_Util         1.2.1   stable

    The Console_Getopt handles the command line stuff and is required if you use the script from the command line

     

    <chris>