27 | | The top-level Makefile will build everything with the following, which places the executables in ./bin. Note that the executables must be run from the root of the project as shown below. |
| 30 | === Compiling the Gateway Watchdog === |
| 31 | |
| 32 | Some packages are required to be installed prior to the compilation of the Gateway Watchdog. Please install the following packages from the Ubuntu repository if you did not do already so. |
| 33 | |
| 34 | {{{ |
| 35 | $ sudo apt-get install gcc g++ libssl-dev libxml2-dev |
| 36 | }}} |
| 37 | |
| 38 | Sockets library also needs to be installed: |
| 39 | |
| 40 | {{{ |
| 41 | $ cd ./lib/Sockets-2.3.7 |
| 42 | $ make clean |
| 43 | $ make |
| 44 | $ sudo make install |
| 45 | }}} |
| 46 | |
| 47 | The top-level Makefile will build everything with the following, which places the executables in ./bin. |
| 85 | |
| 86 | === Test demo === |
| 87 | |
| 88 | The Gateway Watchdog provides monitoring and control of the SENSEI Gateway. To run a demo, please start the Watchdog service by giving the following commands in a console: |
| 89 | |
| 90 | {{{ |
| 91 | $ make |
| 92 | $ ./bin/watchdog -f bin/ -c sensei-gateway -d pub.ro -w test |
| 93 | }}} |
| 94 | |
| 95 | This will start the Gateway Watchdog which runs an http server at '''localhost:9000'''. You will be able to see the registered gateway watchdog URIs by querying the Resource Directory at http://sensei-dev1.grid.pub.ro:8184/rd. |
| 96 | |
| 97 | The watchdog service will now accept requests at the following URIs: |
| 98 | |
| 99 | * Start Gateway http://localhost:9000/start |
| 100 | * Stop Gateway http://localhost:9000/stop |
| 101 | * Update Gateway code http://localhost:9000/update |
| 102 | * Gateway uptime http://localhost:9000/uptime |
| 103 | * Gateway version http://localhost:9000/version |
| 104 | |
| 105 | As an example, by pointing your browser to the [http://localhost:9000/start Start Gateway] URI you should see following response |
| 106 | |
| 107 | Clicking the Start button will start the gateway if it is not already started. You can check that the gateway is running by clicking the following link http://localhost:8000 |
| 108 | |
| 109 | By pointing your browser to the [http://localhost:9000/stop Stop Gateway] URI you should see the following response |
| 110 | |
| 111 | Clicking the Stop button will stop the gateway. |
| 112 | |
| 113 | By pointing your browser to the [http://localhost:9000/update Update Gateway code] URI you will be able to upload a new binary to the gateway and, optionally, specify a version string for this binary, as shown bellow. |
| 114 | |
| 115 | Note that to run the new gateway code you have to stop and then start the gateway. |
| 116 | |
| 117 | = Scheduling = |
| 118 | = Self-healing = |