3 # Script to run the ves project and its dependent containers
4 # Maintainer shrinivas.joshi@xoriant.com
6 #List of containers for this project
8 #collector -- Read the event received from ves-agent and write it to
10 #grafana -- Read the events written by ves-collector in influxdb and
11 # show the graphs on UI
12 #influxdb -- Store the events in DB sent by ves-agent
14 #Port allotment on host system for the micro services running in docker.
16 #Stop all containers if those are running accedently.
24 #Check Docker, collectd and git is installed on the VM
26 #get local ip address of VM from first interface
29 local_ip=`/sbin/ip -o -4 addr list | grep enp | head -n 1 | awk '{print $4}' | cut -d/ -f1`
30 echo -e "Binding VES Services to local ip address $local_ip \n "
32 echo -e "--------------------------------------------------------------------\n"
34 echo -e "Starting influxdb container on Local Port Number $influx_port. Please wait..\n"
35 docker run -d -p $influx_port:8086 -v $PWD/influxdb influxdb
41 sleep 5 #Give some time to spin the container and bring service up
44 echo -e "--------------------------------------------------------------------\n"
45 #Spin Grafana Cotainer
46 echo -e "Starting Grafana cotainer on Local port number $grafana_port. Please wait..\n"
47 docker run -d -p $grafana_port:3000 grafana/grafana
52 sleep 5 #Give some time to spin the container and bring service up
55 echo -e "--------------------------------------------------------------------\n"
57 echo -e "--------------------------------------------------------------------\n"
58 #Spin collector container.
59 echo -e "Starting ves collector container on Local port number $vel_ves_port. Please wait\n"
60 docker run -d -e ves_influxdb_host=$local_ip \
61 -e ves_influxdb_port=$influx_port -e ves_grafana_host=$local_ip \
62 -e ves_grafana_port=$grafana_port -e ves_host=$local_ip \
63 -e ves_port=$vel_ves_port -e ves_grafana_auth='admin:admin' \
64 -e ves_user='user' -e ves_pass='password' -e ves_path=''\
65 -e ves_topic='events' -e ves_loglevel='DEBUG' \
66 -p $vel_ves_port:$vel_ves_port ves-collector
75 echo -e "ves stack summary\n"
77 echo -e "===================================================================================================================\n"
79 echo -e "ves collector listner port: $vel_ves_port \n"
80 echo -e "Grafana port: $grafana_port \n"
81 echo -e "To access grafana dashboard paste url http://$local_ip:$grafana_port in web browser. "
82 echo -e "Grafana username/password is admin/admin *** DO NOT CHANGE THE ADMIN PASSWORD, CLICK SKIP OPTION ***\n"
84 echo -e "===================================================================================================================\n"