Http Thread

  • Creator
    Topic
  • #47747
    Brad Dorr
    Participant

    Has anyone created a thread that talks to a WEB page?  Can you send me some examples?  I would like to create a simple WEB page to stop and start threads, etc..  I see that there is a HTTP protocol you can use on the threads, but I don’t know anything more about it.  ANy info would be useful.  Thanks, for your time.

Viewing 8 reply threads
  • Author
    Replies
    • #56605
      David Barr
      Participant

      Here’s a simple web page that starts threads.  It is a CGI script.

      Code:

      #!/usr/bin/ksh
      echo ‘Content-type: text/plain’
      echo ”
      export QUOVADX_INSTALL_DIR=/hci/qdx5.2
      FPATH=$QUOVADX_INSTALL_DIR/integrator/kshlib
      setroot
      setsite nrh_dvlp
      hcicmd -p aegis -c ‘aegis_to_invision_dvlp pstart’

    • #56606
      Brad Dorr
      Participant

      Thanks for the script, but what I am looking for is some sample WEB code and how to configure a thread to talk to that WEB page.  I would like to be able to click on a WEB button which will start or stop a thread for example.  I don’t know much about WEB pages nor how to design a thread to connect to that WEB Page.

      THanks,

      Brad.

      David Barr wrote:

      Here’s a simple web page that starts threads.

    • #56607
      David Barr
      Participant

      Is your Cloverleaf system running on Windows or Unix (AIX)?

    • #56608
      Brad Dorr
      Participant

      We have 3 AIX Engines and 1 Windows.  I am mainly concerned about the 3 AIX ones for now.  I will worry about the windows one later.  It only has 2 interfaces on it, the others have over 300 interface in total.

    • #56609
      Jonathan Hamilton
      Participant

      Brad,

      It’s simple to do however you do not use the HTTP protocol.  As David alluded to you need to execute some form of cgi script for your commands.  You will also need the AIX HTTPServer (or other HTTP Server) installed/running on the Cloverleaf server to process requests.

      For the web code start with a form and submit button.

       

      I would help you more but you know why I won’t.  Be careful about being to ambitious it may come back to bite you. 😮

      Jonathan

    • #56610
      Charlie Bursell
      Participant

      Look in the $HCIROOT/web directory for some examples of perl CGI scripts to communicate with the engine via Filset/Local and TCP/IP.

      As I stated, these are examples, not cookie cutters.  But it will give you some ideas.

      Charlie

    • #56611
      Anonymous
      Participant

      Brad,

      Here’s how to connect to a web server using the HTTP Client.

      You should probably turn on “enable_all” for your engine output alias so that there’s lots of stuff in the log to look at.

      Select the HTTP Client driver for protocol and press the properties button.

      Type in a URL like “http://www.ebay.com

      Then pick a query TPS:  httpQuery

      And arguments:  {MSGUSE DATA}

      Save and run the thread.  Resend something.  I like to send the pid file since it’s right there and is only one line.

      When I did this from linux it gave me an error, a 404, which means that ebay didn’t like my request.  When I did this from W2K ebay sent me their home page.  Either way, you’re talking to the web server.

    • #56612
      Mark Thompson
      Participant

      Charlie,

      I tried out the examples in $HCIROOT/web.  They look great, but when I run them (Cloverleaf 5.3 on AIX 5.1) my apache server keeps logging the error “QUOVADX_INSTALL_DIR is not set. Exit.”  I have QUOVADX_INSTALL_DIR defined in /etc/environment.  Is there somewhere else it needs to be set so the CL_File.pl and CL_Tcp.pl scripts will run?

      - Mark Thompson
      HealthPartners

    • #56613
      Charlie Bursell
      Participant

      It looks like Apache is not reading the /etc/environment file.  Put it in the .profile of the Apache user or in the Apache Config.

      If not, put code in the script to read the etc/enviroment file and get ir from there

Viewing 8 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,299
Replies
34,443
Topic Tags
288
Empty Topic Tags
10