# NtopngGlobe

Ntopng alerts are displayed in Globe.gl

![Example Image](https://git.dergeorg.at/dergeorg/NtopngGlobe/raw/branch/master/public/images/example.png)

### Install packages
``` sh
npm install
```

### Setup
> :warning: Ntopng webhook **must** point on ```http://<ADRESS>:3100/ws```

### Start Server
``` sh
npm start
```

### Docker
[DockerHub link](https://hub.docker.com/r/dergeorg/ntopngglobe)

#### Run with config file
```sh
docker run -p 3100:3100 -p 8999:8999 --name ntopngglobe -v /PATH/TO/CONF/FOLDER:/usr/src/app/public/conf -d dergeorg/ntopngglobe
```

#### Run without config file (default config)
```sh
docker run -p 3100:3100 -p 8999:8999 --name ntopngglobe -d dergeorg/ntopngglobe
```

### Usage
> :notebook: **Open in browser**: ```http://<ADRESS>:3100```

#### Features 
* Automatic refresh on new Data
* Manual refresh on left-click
* Click on arc reveals whole "Ntopng Alert"
* Hover on arc reveals src/dest ip/hostname

#### Colors
* Orange arc is a bidirectional request (sender and receiver are swapped)
* Red side of arc is receiving
* Green side of arc is sending

### Settings example
[settings.json](https://git.dergeorg.at/dergeorg/NtopngGlobe/src/branch/master/public/conf/settings.json)
```json
{
  "location": {
    "home": {
      "lat": 48.1,
      "lng": 16.3
    },
    "precision": 0
  },
  "colors": {
    "loc": {
      "default": "green",
      "dualsender": "orange"
    },
    "arc": {
      "default": [
        "green",
        "red"
      ],
      "dualsender": [
        "orange",
        "orange"
      ]
    }
  },
  "sizes": {
    "loc": {
      "default": 0.1
    },
    "arc": {
      "default": 1.1
    },
    "globe": {
      "arcDashLength": 0.4,
      "arcAltitudeAutoScale": 0.4,
      "arcDashGap": 0.1,
      "arcDashInitialGap": 0.1,
      "arcDashAnimateTime": 7000,
      "arcStroke": 0.5,
      "labelSize": 0,
      "labelDotRadius": 0.4,
      "labelResolution": 2
    }
  },
  "timer": {
    "del": 30,
    "refreshTimer": 1
  }
}
```
