Commit 3c7bf5b1 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Try to add monitoring

parent e03fe094
...@@ -2,105 +2,94 @@ version: '3' ...@@ -2,105 +2,94 @@ version: '3'
services: services:
graphite: graphite:
restart: always
image: vladwing/graphite image: vladwing/graphite
volumes: volumes:
- graphite_data:/opt/graphite/storage - graphite_data:/opt/graphite/storage
environment:
- VIRTUAL_HOST=graphite.beia.switch
networks: networks:
- web - web
- graphite deploy:
labels:
- "traefik.backend=graphite"
- "traefik.frontend.rule=Host:graphite.beia.switch"
- "traefik.port=80"
grafana: grafana:
restart: always
image: grafana/grafana image: grafana/grafana
environment: environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-secret} - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-secret}
- VIRTUAL_HOST=grafana.beia.switch
volumes: volumes:
- grafana_data:/var/lib/grafana - grafana_data:/var/lib/grafana
depends_on: depends_on:
- graphite - graphite
networks: networks:
- web - web
#monitoring_server: deploy:
#image: salmant/ul_monitoring_server_container_image labels:
#ports: - "traefik.backend=grafana"
#- "8080:8080" - "traefik.frontend.rule=Host:grafana.beia.switch"
#- "4242:4242" - "traefik.port=3000"
#- "4245:4245" monitoring_server:
#- "7199:7199" image: salmant/ul_monitoring_server_container_image
#- "7000:7000" environment:
#- "7001:7001" - MONITORING_SERVER=monitoring_server
#- "9160:9160" networks:
#- "9042:9042" - web
#- "8012:8012" deploy:
#- "61621:61621" labels:
#environment: - "traefik.backend=monitoring_server"
#- MONITORING_SERVER=monitoring_server - "traefik.frontend.rule=Host:jcatascopia.beia.switch"
#- VIRTUAL_HOST=jcatascopia.beia.switch - "traefik.port=8080"
#- VIRTUAL_PORT=8080
#networks:
#- asap
#- web
monitoring_adapter: monitoring_adapter:
restart: always
image: beia/monitoring_adapter image: beia/monitoring_adapter
environment: environment:
- GRAPHITE_SERVER=graphite - GRAPHITE_SERVER=graphite
- MONITORING_PREFIX=eu.beia.switch - MONITORING_PREFIX=eu.beia.switch
- MONITORING_SERVER=${MONITORING_SERVER:-194.249.1.175} - MONITORING_SERVER=monitoring_server
- LOGGING_LEVEL=${LOGGING_LEVEL:-info}
depends_on: depends_on:
- graphite - graphite
#- monitoring_server - monitoring_server
networks: networks:
- graphite - web
- data
- asap
data_collector: data_collector:
image: beia/data_collector image: beia/data_collector
environment: environment:
# - CONFIG=config
- STATSD_HOST=monitoring_adapter - STATSD_HOST=monitoring_adapter
depends_on: depends_on:
# - config
- monitoring_adapter - monitoring_adapter
networks: networks:
# - config - web
- data
alerter: alerter:
image: beia/alerter image: beia/alerter
environment: environment:
# - CONFIG=config
- STATSD_HOST=monitoring_adapter - STATSD_HOST=monitoring_adapter
- VIRTUAL_HOST=alerter.beia.switch
- NOTIFICATION_SERVICE=notify - NOTIFICATION_SERVICE=notify
depends_on: depends_on:
- notify - notify
# - config
networks: networks:
# - config
- web - web
- data deploy:
# config: labels:
# image: beia/config_manager - "traefik.backend=alerter"
# environment: - "traefik.frontend.rule=Host:alerter.beia.switch"
# - TOSCA_URL=${TOSCA_URL:-http://www.google.com} - "traefik.port=80"
# networks:
# - config
web: web:
image: jwilder/nginx-proxy image: traefik
command: --web --docker.swarmmode --docker.watch --logLevel=INFO
ports: ports:
- "80:80/tcp" - "80:80"
- "8081:8080"
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints: [node.role == manager]
networks: networks:
- web - web
notify_asterisk: notify_asterisk:
# TODO: Add shared storage/volume for sounds # TODO: Add shared storage/volume for sounds
restart: always image: beia/asterisk
image: dorinelfilip/ast13
environment: environment:
- SIP_USERNAME=55025 - SIP_USERNAME=55025
- SIP_HOST=sip.clickphone.ro - SIP_HOST=sip.clickphone.ro
...@@ -110,20 +99,22 @@ services: ...@@ -110,20 +99,22 @@ services:
- SIP_PEERNAME=clickphone - SIP_PEERNAME=clickphone
- ARI_USERNAME=${ARI_USERNAME:-admin} - ARI_USERNAME=${ARI_USERNAME:-admin}
- ARI_SECRET=${ARI_SECRET:-changeme} - ARI_SECRET=${ARI_SECRET:-changeme}
deploy:
labels:
- "traefik.docker.network=beia_web"
networks: networks:
- notify_asterisk - web
notify: notify:
restart: always image: beia/notify
image: dorinelfilip/notify
depends_on: depends_on:
- notify_asterisk - notify_asterisk
- notify_redis - notify_redis
networks: networks:
- notify_asterisk - web
- notify_redis # - data
- notify # - sip
- asap # - asap
environment: environment:
- ARI_URL=${ARI_URL:-http://notify_asterisk:8088} - ARI_URL=${ARI_URL:-http://notify_asterisk:8088}
- ARI_USERNAME=${ARI_USERNAME:-admin} - ARI_USERNAME=${ARI_USERNAME:-admin}
...@@ -134,12 +125,15 @@ services: ...@@ -134,12 +125,15 @@ services:
- REDIS_PORT=${REDIS_PORT:-6379} - REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:-changeme} - REDIS_PASSWORD=${REDIS_PASSWORD:-changeme}
- DEFAULT_SIP=${DEFAULT_SIP:-${SIP_PEERNAME}} - DEFAULT_SIP=${DEFAULT_SIP:-${SIP_PEERNAME}}
ports: deploy:
- "8001:80/tcp" labels:
- "traefik.backend=notify"
- "traefik.frontend.rule=Host:notify.beia.switch"
- "traefik.port=80"
notify_redis: notify_redis:
restart: always
image: redis:alpine image: redis:alpine
networks:
- web
entrypoint: entrypoint:
- redis-server - redis-server
- "--requirepass" - "--requirepass"
...@@ -147,20 +141,14 @@ services: ...@@ -147,20 +141,14 @@ services:
# of the container image is needed # of the container image is needed
- ${REDIS_PASSWORD:-changeme} - ${REDIS_PASSWORD:-changeme}
networks: networks:
- notify_redis - web
volumes: volumes:
- redis_data:/data - redis_data:/data
networks:
notify_redis:
notify_asterisk:
notify:
data:
web:
graphite:
asap:
volumes: volumes:
graphite_data: graphite_data:
grafana_data: grafana_data:
redis_data: redis_data:
networks:
web:
...@@ -154,6 +154,11 @@ ...@@ -154,6 +154,11 @@
<artifactId>wadl-client-plugin</artifactId> <artifactId>wadl-client-plugin</artifactId>
<version>1.1.6</version> <version>1.1.6</version>
</dependency> </dependency>
<!-- <dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.71.0</version>
</dependency> -->
</dependencies> </dependencies>
...@@ -208,7 +213,7 @@ ...@@ -208,7 +213,7 @@
</plugin> </plugin>
<!-- <plugin> <!-- <plugin>
<groupId>com.webcohesion.enunciate</groupId> <groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId> <artifactId>enunciate-maven-plugin</artifactId>
<version>2.9.1</version> <version>2.9.1</version>
......
...@@ -61,6 +61,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -61,6 +61,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.authorizeRequests() .authorizeRequests()
.antMatchers("/manager/*").hasRole("ADMIN") .antMatchers("/manager/*").hasRole("ADMIN")
.and() .and()
.authorizeRequests()
.antMatchers("/monitoring/*").hasRole("ADMIN")
.and()
.formLogin() .formLogin()
.and() .and()
.httpBasic() .httpBasic()
......
...@@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.service.PlannerService; import nl.uva.sne.drip.api.service.PlannerService;
import nl.uva.sne.drip.api.service.ToscaService;
import nl.uva.sne.drip.api.service.UserService; import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse; import nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -54,6 +53,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -54,6 +53,7 @@ import org.springframework.web.bind.annotation.RequestParam;
@StatusCodes({ @StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials") @ResponseCode(code = 401, condition = "Bad credentials")
}) })
//@MonitoredWithSpring
public class PlannerController { public class PlannerController {
@Autowired @Autowired
......
#! /bin/bash #! /bin/bash
killall apt
rm /var/lib/dpkg/lock
dpkg --configure -a
apt-get update apt-get update
apt-get -y upgrade apt-get -y upgrade
apt-get -y install software-properties-common python openssh-server sudo apt-get -y install software-properties-common python openssh-server sudo
......
...@@ -638,7 +638,7 @@ public class Consumer extends DefaultConsumer { ...@@ -638,7 +638,7 @@ public class Consumer extends DefaultConsumer {
// paramValue += tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa"; // paramValue += tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa";
paramValue += vm.role + "\n"; paramValue += vm.role + "\n";
} }
//else if (vm == null || !sub.status.equals("running")) { // else if (vm == null || !sub.status.equals("running")) {
// throw new Exception("A VM failed to start. Deleteing all topology"); // throw new Exception("A VM failed to start. Deleteing all topology");
// } // }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment