Version 8 (modified by 14 years ago) (diff) | ,
---|
Table of Contents
Introduction
Architectural Overview
Monitoring and reprogramming
Reprogramming - Gateway Watchdog
The SENSEI Gateway Watchdog is a monitoring and control service for the SENSEI Gateway. It allows for remote starting, stoping and updating the gateway code and can report the version string and uptime of the currently running gateway binary.
Software Requirements
Installing the Gateway Watchdog requires the following software packages:
- Linux PC (Ubuntu)
- g++, make
- Sockets C++ library (Also included in lib/Sockets-2.3.7; make clean; make; make install)
- libxml2, libxml2-dev
- libssl, libssl-dev
Project Organization
The watchdog shares its code with the gateway implementation and can be found in the /gateway folder in the SVN.
- /bin executables
- /src Gateway and Watchdog Code
- /xml Location of resource descriptions
- /lib Sockets++ library
- /config Configuration files (unused)
- /log Log files (unused)
Compiling the Gateway Watchdog
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.
$ sudo apt-get install gcc g++ libssl-dev libxml2-dev
Sockets library also needs to be installed:
$ cd ./lib/Sockets-2.3.7 $ make clean $ make $ sudo make install
The top-level Makefile will build everything with the following, which places the executables in ./bin.
make
To clean everything do
make clean
Running the Gateway Watchdog
The watchdog must be run from the root of the project
./bin/watchdog
Available command line options are:
-p HTTPD port (default: 9000)
-s HTTPD hostname for inserting in resource desciption (default: localhost)
-d domain name inserted in resource description (default: example.com)
-w WSAN island name inserted in resource description (default: Example)
-f folder where the gateway binary can be found (default: ./)
-c gateway binary filename (default: sensei-gateway)
-cert ssl certificate filename, also enables https operation
-pass ssl certificate passphrase, necessary if the certificate file is encrypted
The SENSEI Gateway Watchdog server runs by default on port 9000. It exposes the following URIs:
- /start - a POST request starts the gateway if not already started
- /stop - a POST request stops the gateway
- /update - a POST request with a form that has a 'file' field named 'code' updates the gateway binary, a 'text' field named 'version' can also be sent as the version string for the newly uploaded binary, otherwise version string will be taken from the uploaded file
- /uptime - a GET request returns the uptime of the gateway in seconds or -1 if the gateway is not started
- /version - a GET request returns the gateway version string, if one is available.
For the /start, /stop and /uptime urls GET requests are also accepted. They return an HTML page that allows easy access to the operations from a browser.
Test demo
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:
$ make $ ./bin/watchdog -f bin/ -c sensei-gateway -d pub.ro -w test
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. A possible response from the Resource directory is shown below.
The watchdog service will now accept requests at the following URIs:
- Start Gateway http://localhost:9000/start
- Stop Gateway http://localhost:9000/stop
- Update Gateway code http://localhost:9000/update
- Gateway uptime http://localhost:9000/uptime
- Gateway version http://localhost:9000/version
As an example, by pointing your browser to the Start Gateway URI you should see following response
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
By pointing your browser to the Stop Gateway URI you should see the following response
Clicking the Stop button will stop the gateway.
By pointing your browser to the 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.
Note that to run the new gateway code you have to stop and then start the gateway.
Scheduling
Self-healing
Attachments (22)
-
rd.png (94.4 KB) - added by 14 years ago.
Resource Directory query example
-
start.png (8.3 KB) - added by 14 years ago.
Start gateway response
-
stop.png (8.3 KB) - added by 14 years ago.
Stop gateway response
-
update2.png (14.8 KB) - added by 14 years ago.
Update example
- arhi.png (22.1 KB) - added by 14 years ago.
- sensei+rum.png (34.8 KB) - added by 14 years ago.
- telnet.png (18.7 KB) - added by 14 years ago.
- Monitor_screen1.png (77.6 KB) - added by 14 years ago.
- Monitor_screen2.png (82.9 KB) - added by 14 years ago.
- Percentage_task-scheduling.png (30.8 KB) - added by 14 years ago.
- Runtime_task-scheduling.png (34.4 KB) - added by 14 years ago.
-
NetworkTable.png (33.7 KB) - added by 14 years ago.
RUM network table with multihop
-
sh-config.png (72.2 KB) - added by 14 years ago.
Self-healing: configuration file
-
sh-suspend service.png (27.5 KB) - added by 14 years ago.
Self-healing: suspend the temp service on a node
-
sh-no service.png (43.6 KB) - added by 14 years ago.
Self-healing: nodes are failing without the self-healing service
-
sh-service startup.png (22.4 KB) - added by 14 years ago.
Self-healing: at service startup it recognizes the resources being monitored
-
sh-start node.png (56.4 KB) - added by 14 years ago.
Self-healing: the service starts a node to assure service constraints
-
sh-multi island failing.png (85.9 KB) - added by 14 years ago.
Self-healing: without the help of self-healing, sensor readings lack values
-
sh-multi island new node.png (138.1 KB) - added by 14 years ago.
Self-healing: the temperature service is started on a node in a different island
-
sh-performance.png (249.1 KB) - added by 14 years ago.
Self-healing: timings
- Monitor_screen1.jpg (157.2 KB) - added by 14 years ago.
- Monitor_screen2.jpg (58.9 KB) - added by 14 years ago.
Download all attachments as: .zip