For more information about webAgent, see Using s-Server over the Internet.
The s-Server webAgent accepts certain HTTP requests which represent sql queries, and send the queries to an s-Server. The agent replies with the query results, as json objects.
webAgent functions as a simple, miniature Web server, and is an integral part of SQLstream StreamLab, s-Dashboard, and s-Visualizer. (See json.org for more details on JSON objects.) SQLstream webAgent is delivered as part of the SQLstream Client Tools, in the shell script webagent.sh.
To run webAgent, you initiate its shell script along the following lines:
webagent.sh –-port <port number> -a -w
When run with no arguments, the webAgent runs on port 5580 and uses "localhost" and 5570 as the default host and port for the JDBC connection to s-Server. Each request to webAgent can specify the s-Server host and port, so a single instance of webAgent can communicate with multiple s-Server instances. See Parameters Common to All Requests Below.
The script accepts the arguments described below.
If the –a flag is given, the server provides a monitoring & testing web application viewable by pointing a HTML5-capable browser at the root (such as http://localhost:5580). See Using the webAgent Test Tool. Otherwise, visiting / returns the same as /status. The /sqlstream and /write requests are disabled by default. You enable them using the –w flag. This flag must be specified at startup. When running webAgent as a service, both the test tool and writing to webAgent can be enabled through a script located at /etc/default/webagentd. See Running Webagentd as a Service for more details.
In order to run the \read \write or \sqlstream APIs, you need to be running one of the following browsers: Microsoft Internet Explorer 11 (or later), Google Chrome 31 (or later), Mozilla Firefox 17 (or later), or Apple Safari 7 (or later).
Option | Alias | Description |
---|---|---|
-a | --enable-app | Enables webAgent Test tool. See Using the webAgent Test Tool for more details. |
-p |
--port |
Selects webAgent port. Default is 5580 |
-sn |
--SQLstream-name |
Specifies s-Server user name, default is “” |
-sp |
--SQLstream-password |
Specifies s-Server password, default is “” |
-su |
--SQLstream-url |
Specifies s-Server JDBC URL, default is “jdbc:sqlstream:sdp://localhost:5570” |
-w | --enable-write | Enables writable services (/sqlstream and /write) |
-g |
--debug |
Sets a debug port for webAgent |
-v | --verbose | Enables verbose mode |
--help | Shows help message | |
-D |
Sets a java property, such as:webagent.sh -Dwebagent.stream.fetchTimeout=30orwebagent.sh -Dwebsocket.maxwaitforwrite=N (where N is seconds. Default is 10 seconds) |