Skip to content

Commit

Permalink
deliverable 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 24, 2021
1 parent a9062cc commit baa0308
Show file tree
Hide file tree
Showing 16 changed files with 962 additions and 133 deletions.
10 changes: 5 additions & 5 deletions Dockerfiles/ansible.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ POSTGRES_USER=mism
POSTGRES_PASSWORD=mismpass
POSTGRES_DB=mism

NO_PROXY=127.0.0.1,localhost,0.0.0.0:9090,0.0.0.0,ansible,awx,awx_web,awx_task,rabbitmq,awx_postgres,memcached,elasticsearch,kibana,logstash,filebeat,metricbeat,heartbeat,auditbeat,grafana,prometheus,nodeexporter,caddy,cadvisor,alertmanager,172.31.130.224,172.31.60.18,172.31.92.239,172.31.100.156,172.31.60.18,172.31.92.249,172.31.92.222,172.31.92.44,172.31.92.34,172.31.120.13,172.31.120.11,172.31.92.239,172.31.92.49
HTTP_PROXY=http://193.56.47.20:8080
http_proxy=http://193.56.47.20:8080
HTTPS_PROXY=http://193.56.47.20:8080
https_proxy=http://193.56.47.20:8080
NO_PROXY=127.0.0.1,localhost,172.31.130.224,172.31.60.18,172.31.92.239,172.31.100.156,172.31.60.18,172.31.92.249,172.31.92.222,172.31.92.44,172.31.92.34,webserver,0.0.0.0:9090,0.0.0.0,ansible,awx,rabbitmq,postgres,memcached,elasticsearch,kibana,logstash,filebeat,metricbeat,heartbeat,auditbeat,grafana,prometheus,172.31.130.224,172.31.60.18,172.31.92.239,172.31.100.156,172.31.60.18,172.31.92.249,172.31.92.222,172.31.92.44,172.31.92.34,172.31.120.11,172.31.120.13,172.31.93.233,172.31.92.65,172.31.92.66,172.31.92.67,172.31.92.68,172.31.92.104,172.31.92.104,172.31.92.171
HTTP_PROXY=http://193.56.47.8:8080/
http_proxy=http://193.56.47.8:8080/
HTTPS_PROXY=http://193.56.47.8:8080/
https_proxy=http://193.56.47.8:8080/
2 changes: 1 addition & 1 deletion Dockerfiles/loginModal.partial.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</div>
</div>
<div class="LoginModal-footer">
version: 2.1.3
version: 2.1.4
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions Dockerfiles/zabbix.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ZBX_TIMEOUT=9
# ZBX_UNAVAILABLEDELAY=60
# ZBX_UNREACHABLEDELAY=15

NO_PROXY=127.0.0.1,localhost
HTTP_PROXY=http://193.56.47.20:8080/
http_proxy=http://193.56.47.20:8080/
HTTPS_PROXY=http://193.56.47.20:8080/
https_proxy=http://193.56.47.20:8080/
NO_PROXY=127.0.0.1,localhost,172.31.130.224,172.31.60.18,172.31.92.239,172.31.100.156,172.31.60.18,172.31.92.249,172.31.92.222,172.31.92.44,172.31.92.34,webserver,0.0.0.0:9090,0.0.0.0,ansible,awx,rabbitmq,postgres,memcached,elasticsearch,kibana,logstash,filebeat,metricbeat,heartbeat,auditbeat,grafana,prometheus,172.31.130.224,172.31.60.18,172.31.92.239,172.31.100.156,172.31.60.18,172.31.92.249,172.31.92.222,172.31.92.44,172.31.92.34,172.31.120.11,172.31.120.13,172.31.93.233,172.31.92.65,172.31.92.66,172.31.92.67,172.31.92.68,172.31.92.104,172.31.92.104,172.31.92.171
HTTP_PROXY=http://193.56.47.8:8080/
http_proxy=http://193.56.47.8:8080/
HTTPS_PROXY=http://193.56.47.8:8080/
https_proxy=http://193.56.47.8:8080/
4 changes: 2 additions & 2 deletions ansible/playbooks/openbmc/inventory/get_FRU.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: Get FRU Inventory
uri:
url: https://{{ baseuri }}/xyz/openbmc_project/inventory/system
url: https://{{ baseuri }}/xyz/openbmc_project/inventory/system/enumerate
method: GET
validate_certs: no
headers:
Expand All @@ -25,4 +25,4 @@
- name: Render json FRU
debug:
var: FRU_inventory
when: FRU_inventory is defined
when: FRU_inventory is defined
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,12 @@ def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=Fal

if abridged_result:
if not render_one:
dumped += '\n'
dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=AnsibleDumper, default_flow_style=False)).replace("xyz.openbmc_project.", "")
dumped += '\n'
frus = result.get("frus", None)
if frus:
dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=AnsibleDumper, default_flow_style=False)).replace("xyz.openbmc_project.", "").replace("/xyz/openbmc_project/inventory/system/chassis/motherboard/","")
else:
dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=AnsibleDumper, default_flow_style=False)).replace("xyz.openbmc_project.", "")

# indent by a couple of spaces
if not render_one:
Expand Down
25 changes: 16 additions & 9 deletions build_awx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,27 @@ while true; do
esac
done

. ./check_prerequisites.sh
. ./remove_awx_containers.sh
#. ./check_prerequisites.sh
#. ./remove_awx_containers.sh
. ./versions.sh

echo "building BullSequana Edge Ansible AWX containers and images ...."
docker-compose -f docker_compose_awx.yml build
export REGISTRY=ansible
docker-compose -f docker_compose_awx.yml build \
--build-arg MISM_BULLSEQUANA_EDGE_VERSION=$MISM_BULLSEQUANA_EDGE_VERSION \
--build-arg REGISTRY=$REGISTRY \
--build-arg BASE_IMAGE_AWX_TASK=$BASE_IMAGE_AWX_TASK \
--build-arg TAG_AWX=$AWX_BULLSEQUANA_EDGE_VERSION \
--build-arg BASE_IMAGE_AWX_WEB=$BASE_IMAGE_AWX_WEB \
--no-cache

echo "saving BullSequana Edge Ansible AWX containers and images in tar files ...."
echo -e "\033[31mit will take several minutes\033[0m"
docker save -o bullsequana-edge-system-management_awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_awx_task:$MISM_BULLSEQUANA_EDGE_VERSION
docker save -o bullsequana-edge-system-management_awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_awx_web:$MISM_BULLSEQUANA_EDGE_VERSION
#docker save -o bullsequana-edge-system-management_awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_awx_task:$MISM_BULLSEQUANA_EDGE_VERSION
#docker save -o bullsequana-edge-system-management_awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_awx_web:$MISM_BULLSEQUANA_EDGE_VERSION

echo "... save completed"
echo "----------------------------------------------------------------------------------------------------"
echo -e "\033[31mnow you can run ./install_awx.sh... enjoy your customization !!\033[0m"
echo "----------------------------------------------------------------------------------------------------"
#echo "... save completed"
#echo "----------------------------------------------------------------------------------------------------"
#echo -e "\033[31mnow you can run ./install_awx.sh... enjoy your customization !!\033[0m"
#echo "----------------------------------------------------------------------------------------------------"

36 changes: 22 additions & 14 deletions build_zabbix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,29 @@ while true; do
esac
done

. ./check_prerequisites.sh
. ./remove_zabbix_containers.sh
#. ./check_prerequisites.sh
#. ./remove_zabbix_containers.sh
. ./versions.sh

echo "building BullSequana Edge Zabbix containers and images ...."
docker-compose -f docker_compose_zabbix.yml build

echo "saving BullSequana Edge Zabbix containers and images in tar files ...."
echo -e "\033[31mit will take several minutes\033[0m"
docker save -o bullsequana-edge-system-management_zabbix-web.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-web:$MISM_BULLSEQUANA_EDGE_VERSION
docker save -o bullsequana-edge-system-management_zabbix-agent.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-agent:$MISM_BULLSEQUANA_EDGE_VERSION
docker save -o bullsequana-edge-system-management_zabbix-server.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-server:$MISM_BULLSEQUANA_EDGE_VERSION

echo "... save completed"
echo "----------------------------------------------------------------------------------------------------"
echo -e "\033[31mnow you can run ./install_zabbix.sh... enjoy your customization !!\033[0m"
echo "----------------------------------------------------------------------------------------------------"
export REGISTRY=zabbix
docker-compose -f docker_compose_zabbix.yml build \
--build-arg MISM_BULLSEQUANA_EDGE_VERSION=$MISM_BULLSEQUANA_EDGE_VERSION \
--build-arg REGISTRY=$REGISTRY \
--build-arg BASE_IMAGE_ZABBIX=$BASE_IMAGE_ZABBIX \
--build-arg TAG_ZABBIX=$ZABBIX_BULLSEQUANA_EDGE_VERSION \
--build-arg BASE_IMAGE_ZABBIX_WEB=$BASE_IMAGE_ZABBIX_WEB \
--build-arg BASE_IMAGE_ZABBIX_AGENT=$BASE_IMAGE_ZABBIX_AGENT \
--no-cache

#echo "saving BullSequana Edge Zabbix containers and images in tar files ...."
#echo -e "\033[31mit will take several minutes\033[0m"
#docker save -o bullsequana-edge-system-management_zabbix-web.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-web:$MISM_BULLSEQUANA_EDGE_VERSION
#docker save -o bullsequana-edge-system-management_zabbix-agent.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-agent:$MISM_BULLSEQUANA_EDGE_VERSION
#docker save -o bullsequana-edge-system-management_zabbix-server.$MISM_BULLSEQUANA_EDGE_VERSION.tar bullsequana-edge-system-management_zabbix-server:$MISM_BULLSEQUANA_EDGE_VERSION

#echo "... save completed"
#echo "----------------------------------------------------------------------------------------------------"
#echo -e "\033[31mnow you can run ./install_zabbix.sh... enjoy your customization !!\033[0m"
#echo "----------------------------------------------------------------------------------------------------"

4 changes: 2 additions & 2 deletions docker_compose_awx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: bullsequana-edge-system-management_awx_web:${MISM_BULLSEQUANA_EDGE_VERSION}
build:
context: Dockerfiles
dockerfile: Dockerfile-awx_web.${MISM_TAG_BULLSEQUANA_EDGE_VERSION}
dockerfile: Dockerfile-awx_web
container_name: awx_web
depends_on:
- rabbitmq
Expand Down Expand Up @@ -41,7 +41,7 @@ services:
image: bullsequana-edge-system-management_awx_task:${MISM_BULLSEQUANA_EDGE_VERSION}
build:
context: Dockerfiles
dockerfile: Dockerfile-awx_task.${MISM_TAG_BULLSEQUANA_EDGE_VERSION}
dockerfile: Dockerfile-awx_task
container_name: awx_task
depends_on:
- rabbitmq
Expand Down
6 changes: 3 additions & 3 deletions docker_compose_zabbix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: bullsequana-edge-system-management_zabbix-server:${MISM_BULLSEQUANA_EDGE_VERSION}
build:
context: Dockerfiles
dockerfile: Dockerfile-zabbix.${MISM_TAG_BULLSEQUANA_EDGE_VERSION}
dockerfile: Dockerfile-zabbix
ports:
- 10051:10051
expose:
Expand Down Expand Up @@ -33,7 +33,7 @@ services:
image: bullsequana-edge-system-management_zabbix-web:${MISM_BULLSEQUANA_EDGE_VERSION}
build:
context: Dockerfiles
dockerfile: Dockerfile-zabbix-web.${MISM_TAG_BULLSEQUANA_EDGE_VERSION}
dockerfile: Dockerfile-zabbix-web
restart: always
container_name: zabbix-web
env_file:
Expand All @@ -55,7 +55,7 @@ services:
image: bullsequana-edge-system-management_zabbix-agent:${MISM_BULLSEQUANA_EDGE_VERSION}
build:
context: Dockerfiles
dockerfile: Dockerfile-zabbix-agent.${MISM_TAG_BULLSEQUANA_EDGE_VERSION}
dockerfile: Dockerfile-zabbix-agent
ports:
- 10050:10050
expose:
Expand Down
7 changes: 7 additions & 0 deletions proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ zabbix_file=Dockerfiles/zabbix.env

grep -q NO_PROXY= $ansible_file && sed -i.bak '/NO_PROXY=.*/d' $ansible_file
grep -q NO_PROXY= $zabbix_file && sed -i.bak '/NO_PROXY=.*/d' $zabbix_file
grep -q no_proxy= $ansible_file && sed -i.bak '/no_proxy=.*/d' $ansible_file
grep -q no_proxy= $zabbix_file && sed -i.bak '/no_proxy=.*/d' $zabbix_file
if [ -v NO_PROXY ]
then
echo "NO_PROXY=$NO_PROXY" >> $ansible_file
echo "NO_PROXY=$NO_PROXY" >> $zabbix_file
echo "no_proxy=$NO_PROXY" >> $ansible_file
echo "no_proxy=$NO_PROXY" >> $zabbix_file
echo "NO_PROXY="$NO_PROXY
echo "no_proxy="$no_proxy
else
echo "NO_PROXY environment variable not found"
fi
Expand All @@ -28,6 +33,7 @@ then
echo "http_proxy=$HTTP_PROXY" >> $ansible_file
echo "http_proxy=$HTTP_PROXY" >> $zabbix_file
echo "HTTP_PROXY="$HTTP_PROXY
echo "http_proxy="$http_proxy
else
echo "HTTP_PROXY environment variable not found"
fi
Expand All @@ -43,6 +49,7 @@ then
echo "https_proxy=$HTTPS_PROXY" >> $ansible_file
echo "https_proxy=$HTTPS_PROXY" >> $zabbix_file
echo "HTTPS_PROXY="$HTTPS_PROXY
echo "https_proxy="$https_proxy
else
echo "HTTPS_PROXY environment variable not found"
fi
Expand Down
10 changes: 9 additions & 1 deletion zabbix/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ You must add 3 macros on each mipocket host:
![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/macros.png)

## <a name="edge_template"></a>How to install LLD BullSequana Edge template
### template order
This template should be the **first** imported template.

### template content
- applications: All items are categorized inside applications with the following rules :
![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/Applications.png)
Expand Down Expand Up @@ -305,10 +308,12 @@ Volt: *
![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/network.png)

## <a name="host_template"></a>How to install BullSequana Edge Host template
### template order
This template should be the **second** imported template.
### template content
- 1 host as an example
### prerequisite
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Info: You should install LLD Bull Sequana Edge before: [How to install BullSequana Edge template](#edge_template)
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Info: You should install LLD and Sysmap Bull Sequana Edge templates before: [How to install BullSequana Edge template](#edge_template)
### import
1. Copy the templates from <install_dir>\zabbix\server\externalscripts\ to a **local path on you client computer running the browser**
2. Open a browser and go to Configuration / **Hosts**
Expand Down Expand Up @@ -461,6 +466,9 @@ You can flush the iptables rules
![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Be careful to be able to recreate iptables rules after this command ` iptables -F `

## <a name="map_template"></a>BullSequanaEdgeMap template installation
### template order
This template should be the **third** imported template.

### template content
- 1 Map template
![#f03c15](https://placehold.it/15/f03c15/000000?text=+) WARNING: The BullSequanaEdgeIconMapping should be created BEFORE importing BullSequanaEdgeMap template [Create BullSequanaEdge icons](#create_icons) and [Create BullSequanaEdge icon mapping](#create_icon_mapping)
Expand Down
1 change: 0 additions & 1 deletion zabbix/server/externalscripts/openbmc_collect
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import sys
import requests
import urllib
import urllib3
from requests.auth import HTTPBasicAuth
import os
Expand Down
1 change: 0 additions & 1 deletion zabbix/server/externalscripts/openbmc_discovery_nmap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import os
import json
import argparse
import requests
import urllib
import urllib3
from requests.auth import HTTPBasicAuth

Expand Down
19 changes: 5 additions & 14 deletions zabbix/server/externalscripts/openbmc_lld
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import sys
import requests
import urllib
import urllib3
from requests.auth import HTTPBasicAuth
import os
Expand All @@ -42,7 +41,7 @@ def write_collect(file_name, json_to_write):
with open(file_name, 'w') as file_to_write:
json.dump(json_to_write, file_to_write)

def create_macro_lld(macro, json_lld, substring_to_remove, b_timeout):
def create_macro_lld(macro, json_lld, substring_to_remove):
macros = {}
discovery_list = []
macro_key = r"{#" + macro + r"}"
Expand Down Expand Up @@ -84,21 +83,13 @@ def main(args):
try:
response = requests.get(uri, auth=HTTPBasicAuth(args.user.strip(), password), verify=False, timeout=timeout)
data = response.json()
b_Timeout = False
except requests.exceptions.Timeout:
# Maybe set up for a retry, or continue in a retry loop
b_Timeout = True
except requests.exceptions.TooManyRedirects:
# Tell the user their URL was bad and try a different one
b_Timeout = True
except requests.exceptions.RequestException as e:
# catastrophic error. bail.
b_Timeout = True

except Exception as e:
data["data"] = None

item = args.item.strip()
filename, macro = get_filename(item, args.bmc.strip())
write_collect(filename, data["data"])
macro_list = create_macro_lld(macro, data["data"], item.split('enumerate')[0], b_Timeout)
macro_list = create_macro_lld(macro, data["data"], item.split('enumerate')[0])
macro_json = json.dumps(macro_list)
print('{macro_json}'.format(macro_json=macro_json))

Expand Down
2 changes: 2 additions & 0 deletions zabbix/server/externalscripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
urllib3
requests
pycryptodome
nmap
Loading

0 comments on commit baa0308

Please sign in to comment.