... | ... | @@ -125,6 +125,61 @@ Add your ElasticSearch as a DataFrame and click test to confirm. |
|
|
```
|
|
|
8. Run both ElasticSearch and Kibana services with the script `launch_script.sh`
|
|
|
|
|
|
# Running ElasticMon Server
|
|
|
|
|
|
## Connecting FlexRAN with ElasticSearch
|
|
|
|
|
|
1. First, we have to make sure that FlexRAN is already running well by getting the status of connected UE
|
|
|
```
|
|
|
curl -X GET http://<url_flexran>:9999/stats
|
|
|
```
|
|
|
If FlexRAN is working well, the result should give you the stats of UE
|
|
|
2. Run elasticmon_server.py
|
|
|
Because elasticmon server is using flask, it is better that you run elasticmon server in pip virtual environment, to separate this project from your existing project.
|
|
|
```
|
|
|
sudo apt install virtualenv # to install virtual environment
|
|
|
virtualenv test1 # create the virtual environment named test1
|
|
|
source test1/bin/activate # activate the virtual environment
|
|
|
pip install flask # install flask
|
|
|
deactivate # deactivate and exit from the virtual environment
|
|
|
```
|
|
|
Before running the elasticmon_server python code, we need to make sure that below lines are **at the last part** of the code. (If not, please update in your environment)
|
|
|
```
|
|
|
if __name__ = "__main__":
|
|
|
app.run(host='0.0.0.0', debug= True)
|
|
|
```
|
|
|
These lines will run the flask application in your host which can be accessible from the outside network.
|
|
|
After that, activate your virtual environment again and run `elasticmon_server.py` inside `ElasticMON_WebServer` by using this simple command
|
|
|
```
|
|
|
python elasticmon_server.py
|
|
|
```
|
|
|
3. Open another terminal and add ES endpoint to FlexRAN then see the status
|
|
|
```
|
|
|
curl -X POST http://<url_flexran>:9999/elasticmon/endpoint/<url_elasticsearch>:9200
|
|
|
curl -X GET http://<url_flexran>:9999/elasticmon | jq
|
|
|
```
|
|
|
At this point, you can see that now our ElasticSearch endpoint has been added succesfully to FlexRAN
|
|
|
4. Enable FlexRAN's logging // activate FlexRAN producer and see the status
|
|
|
```
|
|
|
curl -X POST http://<url_flexran>:9999/elasticmon/enable
|
|
|
curl -X GET http://<url_flexran>:9999/elasticmon | jq
|
|
|
```
|
|
|
At this point, you should see the status is already active.
|
|
|
|
|
|
**Notes:**
|
|
|
- At this point, if everything works fine, mac_stats and enb_config data from FlexRAN will be throw out to ElasticSearch continously. If you want to change the period of time to throw data from FlexRAN to ElasticSearch, or change the batch size, and another configuration, see FlexRAN’s APIdocs section [ElasticMonitoring here](http://mosaic-5g.io/apidocs/flexran/#api-ElasticMonitoring).
|
|
|
- From this point, you can extract your data directly from ElasticMon, not from FlexRAN. So, next step is get the data from ElasticMon, either from web browser or curl command.
|
|
|
|
|
|
## Get data from ElasticMon
|
|
|
For example: get the latest MAC status. You have 2 options to get the data: from web browser or using curl command in terminal.
|
|
|
1) From web browser
|
|
|
Type `http://elasticmonserver:5000/latest/mac_stats/`
|
|
|
2) Using curl command
|
|
|
```
|
|
|
curl -X GET http://<url_elasticmon>:5000/latest/mac_stats/
|
|
|
```
|
|
|
|
|
|
|
|
|
# Use Case examples
|
|
|
|
|
|
There are more than one way to interract with an ElasticSearch server. Visit [ElasticSearch Clients](https://www.elastic.co/guide/en/elasticsearch/client/index.html) or [ElasticSearch Community Contributed Clients](https://www.elastic.co/guide/en/elasticsearch/client/community/current/index.html) to see the list of clients they support.
|
... | ... | |