Skip to content

Commit

Permalink
synchro with bitbucket 2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
frsauvage committed Feb 26, 2020
1 parent f46421c commit 373241c
Show file tree
Hide file tree
Showing 25 changed files with 281 additions and 27 deletions.
9 changes: 5 additions & 4 deletions Dockerfiles/Dockerfile-zabbix-web.latest
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ FROM zabbix/zabbix-web-nginx-pgsql:centos-latest

ENV MISM_BULLSEQUANA_EDGE_VERSION=latest

COPY items.inc.php /usr/share/zabbix/include/
COPY logo-header.svg /usr/share/zabbix/assets/img/
COPY dark-theme.css /usr/share/zabbix/assets/styles/
COPY blue-theme.css /usr/share/zabbix/assets/styles/
COPY items.inc.php /usr/share/zabbix/include/
COPY logo-header.svg /usr/share/zabbix/assets/img/
COPY logo-zabbix-header.png /usr/share/zabbix/assets/img/
COPY dark-theme.css /usr/share/zabbix/assets/styles/
COPY blue-theme.css /usr/share/zabbix/assets/styles/


1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile-zabbix-web.tag
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV MISM_BULLSEQUANA_EDGE_VERSION=2.0.7

COPY items.inc.php /usr/share/zabbix/include/
COPY logo-header.svg /usr/share/zabbix/assets/img/
COPY logo-zabbix-header.png /usr/share/zabbix/assets/img/
COPY dark-theme.css /usr/share/zabbix/assets/styles/
COPY blue-theme.css /usr/share/zabbix/assets/styles/

Expand Down
4 changes: 2 additions & 2 deletions Dockerfiles/blue-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ output {
float: left;
display: block;
width: 95px;
height: 25px;
height: 35px;
background: url(../img/logo-header.svg) no-repeat 0;
background-size: 95px 30px;
}
Expand Down Expand Up @@ -2254,7 +2254,7 @@ button[disabled], button[disabled]:hover, button[disabled]:active {
margin-bottom: 21px;
width: 114px;
height: 30px;
background: url(../img/logo-header.svg) no-repeat 0;
background: url(../img/logo-zabbix-header.png) no-repeat 0;
background-repeat: no-repeat;
background-size: 114px 30px;
}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/dark-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ button[disabled], button[disabled]:hover, button[disabled]:active {
margin-bottom: 21px;
width: 114px;
height: 30px;
background: url(../img/icon-sprite.svg) no-repeat 0 -864px; }
background: url(../img/logo-zabbix-header.png) no-repeat 0 -864px; }

.signin-links {
width: 100%;
Expand Down
Binary file added Dockerfiles/logo-zabbix-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
- name: get activation failures
fail:
msg: "{{ item.value.Activation }}"
when: reboot == False and item.value.Activation is defined and item.value.Activation == 'xyz.openbmc_project.Software.Activation.Activations.Failed' and item.value.RequestedActivation is defined and item.value.RequestedActivation =='xyz.openbmc_project.Software.Activation.RequestedActivations.Active'
when: item.value.Activation is defined and item.value.Activation == 'xyz.openbmc_project.Software.Activation.Activations.Failed' and item.value.RequestedActivation is defined and item.value.RequestedActivation =='xyz.openbmc_project.Software.Activation.RequestedActivations.Active'
with_dict: "{{ firmware_inventory }}"


Expand Down
4 changes: 2 additions & 2 deletions ansible/playbooks/openbmc/firmware/update_firmwares.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@
- name: pause {{ reboot_countdown }} minuts for BMC to reboot
pause:
minuts: "{{ reboot_countdown }}"
when: reboot == True and item.value.Activation is defined and item.value.Purpose is defined and item.value.Activation == "xyz.openbmc_project.Software.Activation.Activations.Ready" and item.value.Purpose == "xyz.openbmc_project.Software.Version.VersionPurpose.BMC"
when: reboot == True and item.value.Purpose is defined and item.value.RequestedActivation is defined and item.value.Purpose == "xyz.openbmc_project.Software.Version.VersionPurpose.BMC" and item.value.RequestedActivation == "xyz.openbmc_project.Software.Activation.RequestedActivations.Active"
with_dict: "{{ firmware_inventory }}"

- include_tasks: ../utils/utils_firmware_inventory.yml

- name: check Activation Failures
fail:
msg: "Failure in activation for {{item.value.Purpose}} - {{item.value.Version}}"
when: reboot == False and item.value.Activation is defined and item.value.Activation == 'xyz.openbmc_project.Software.Activation.Activations.Failed' and item.value.RequestedActivation is defined and item.value.RequestedActivation =='xyz.openbmc_project.Software.Activation.RequestedActivations.Active'
when: item.value.Activation is defined and item.value.Activation == 'xyz.openbmc_project.Software.Activation.Activations.Failed' and item.value.RequestedActivation is defined and item.value.RequestedActivation =='xyz.openbmc_project.Software.Activation.RequestedActivations.Active'
with_dict: "{{ firmware_inventory }}"

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from ansible.module_utils._text import to_text
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.utils.color import colorize, hostcolor
from ansible.utils.unsafe_proxy import AnsibleUnsafeText
from ansible.plugins.callback import CallbackBase, strip_internal_keys, module_response_deepcopy
from ansible.plugins.callback.default import CallbackModule as Default

Expand Down Expand Up @@ -90,29 +91,48 @@ def _display_result_output(self, result, msg, display_color, err=None, render_on
self.deep_serialize_logs(task_result, logs, True)
return

# Upload
if result._result.get('url') and result._result.get('msg') and "/upload/image" in result._result.get('url') :
# Upload
if result._result.get('url', None) and result._result.get('msg', None) and "/upload/image" in result._result.get('url', None) :
# specific case : not a failure => Version already exists OR tar extraction error
json_body = result._result.get('json', None)
if not json_body: # return default msg
task_result += " | " + to_text(result._result.get('msg', None))
self._display.display(task_result, display_color, stderr=err)
return

json_data = json_body.get('data', None)
if not json_data: # return default msg
task_result += " | " + to_text(result._result.get('msg', None))
self._display.display(task_result, display_color, stderr=err)
return

if type(json_data) is str:
task_result += " | Upload: " + json_data
self._display.display(task_result, display_color, stderr=err)
return


if type(json_data) is AnsibleUnsafeText :
task_result_final = "{task_result} | image id: {json_data}".format(task_result=task_result, json_data=json_data)
self._display.display(task_result_final, display_color, stderr=err)
return

data_description = json_data.get('description', None)

if data_description:
task_result += " | " + to_text(data_description)
self._display.display(task_result, display_color, stderr=err)
return


# else = return default msg
task_result += " | " + to_text(result._result.get('msg', None))
self._display.display(task_result, display_color, stderr=err)
self._display.display("Pas de description Upload", display_color, stderr=err)
msg = result._result.get('msg', None)
if msg:
task_result += " | " + to_text(msg)
self._display.display(task_result, display_color, stderr=err)
return
self._display.display("OK Upload", display_color, stderr=err)
return

# debug msg
Expand Down
3 changes: 2 additions & 1 deletion generate_encrypted_password_for_zabbix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

echo -n Please enter the password you want to encrypt:
read -s password
echo $password

echo

ZABBIXCMD="./encrypt_psk_password"

Expand Down
11 changes: 6 additions & 5 deletions generate_psk_key_for_zabbix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ sed -i 's/#.*TLSPSKIdentity.*=.*/TLSPSKIdentity=PSK_Mipocket_Agent/g' zabbix/age
sed -i 's/#.*TLSPSKFile.*=.*/TLSPSKFile=\/etc\/zabbix\/zabbix_agentd.psk/g' zabbix/agent/zabbix_agentd.conf

echo "Steps to activate Encryption"
echo "In Zabbix / Configuration / Hosts / selected_host / Encryption"
echo -e "Connections to host : <select \033[32mPSK\033[0m>"
echo -e "Connections from host : <select \033[32mPSK\033[0m>"
echo -e "\033[32mPSK Identity: PSK_Mipocket_Agent\033[0m"
echo -e "\033[32mPSK:$zabbix_psk\033[0m"
echo "1. Got to Zabbix / Configuration / Hosts / selected_host / Encryption"
echo "2. Select:"
echo -e "- Connections to host : <select \033[32mPSK\033[0m>"
echo -e "- Connections from host : <select \033[32mPSK\033[0m>"
echo -e "\033[32m- PSK Identity: PSK_Mipocket_Agent\033[0m"
echo -e "\033[32m- PSK:$zabbix_psk\033[0m"
echo -e "\033[31m!!WARNING: You should repeat these steps for zabbix-server itself and ALL your hosts\033[0m"
echo
echo "This psk is available in <install_dir>/zabbix/agent/zabbix_agentd.psk file"
Expand Down
2 changes: 1 addition & 1 deletion install_zabbix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# comment the next line if you build from your own Dockerfiles with build_zabbix.sh
. ./remove_zabbix_containers.sh

chmod uo+w zabbix/server/externalscripts/openbmc
chmod ugo+w zabbix/server/externalscripts/openbmc

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion install_zabbix_from_atos_dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
. ./check_prerequisites.sh
. ./remove_awx_containers.sh

chmod uo+w zabbix/server/externalscripts/openbmc
chmod ugo+w zabbix/server/externalscripts/openbmc

set -euo pipefail

Expand Down
Binary file added zabbix/doc/BullSequanaEdge_create_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/doc/BullSequanaEdge_icon_mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/doc/BullSequanaEdge_images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/icons/BullSequanaEdge128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/icons/BullSequanaEdge24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/icons/BullSequanaEdge48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/icons/BullSequanaEdge64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zabbix/icons/BullSequanaEdge96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions zabbix/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Optionally, 3 ready-to-go zabbix images are available on Dockerhub
- [What to do first](#what_first)
- [How to install BullSequana Edge template](#edge_template)
- [How to install rsyslog template](#rsyslog_template)
- [How to install BullSequana Edge Map template](#map_template)
- [How to create your first Edge dashboard](#dashboard)
- [How to change your Proxy](#howto_proxy)
- [How to change Local Date / Time Zone](#datetimezone)
Expand Down Expand Up @@ -413,6 +414,36 @@ 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 content
- 1 Map template

![#f03c15](https://placehold.it/15/f03c15/000000?text=+) The BullSequanaEdgeInconMapping should be created BEFORE importing BullSequanaEdgeMap template

### Create BullSequanaEdge icons

1. From your browser, you should be able to access <instal_dir>/zabbix/icons directory
2. Go to Administration / General / Image / Icon
3. Create as many icons as images in <instal_dir>/zabbix/icons directory
![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/BullSequanaEdge_create_icon.png)
4. Check your icons
![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/BullSequanaEdge_images.png)

### Create BullSequanaEdge icon mapping

1. Go to Administration / General / Image / IconMapping
2. Create one "Icon Mapping" as below:
a- Name should be BullSequanaEdgeIconMapping
b- Select Inventory field = Model
c- Write Expression = BullSequana Edge
d- Select your prefered Icon Size and Default Icon Size

![alt text](https://github.com/atosorigin/bullsequana-edge-system-management/blob/master/zabbix/doc/BullSequanaEdge_icon_mapping.png.png)

![#f03c15](https://placehold.it/15/f03c15/000000?text=+) WARNING: Inventory should be "Automatic" for your BullSequana Edge (Model field should be filled)

![#c5f015](https://placehold.it/15/c5f015/000000?text=+) INFO: Your icons will be automatically detected for BullSequana Edge

## <a name="howto_proxy"></a>How to change your proxy
By default, when you start the installer, the proxy environment variables are added in containers thanks to the following section in docker-compose-awx.yml file:

Expand Down
6 changes: 3 additions & 3 deletions zabbix/server/externalscripts/encrypt_psk_password
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# by francine.sauvage@atos.net
#
# ./encrypt_psk_password --password=sdd@atos
# ./encrypt_psk_password
import sys
import argparse
from openbmc_psk_password import AESCipher
Expand All @@ -28,8 +28,8 @@ def main(args):
if not password:
print(r"Error: you should generate a psk key with generate_psk_key_for_zabbix.sh and follow the instructions")
return None
print(r"copy/paste generated line to zabbix / Configuration / Hosts / your host / Macros / {$PASSWORD} value : ")
print(password)
print("1. Go to Configuration / Hosts / <your host> / Macros")
print(r"2. Copy and paste {$PASSWORD} value : "+ password)
return password

if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions zabbix/server/externalscripts/openbmc_psk_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
class AESCipher:
def __init__(self,data):
self.key=None
if os.path.exists('/etc/zabbix/zabbix_agentd.psk'):
with open('/etc/zabbix/zabbix_agentd.psk', 'r') as psk_file:
self.key = psk_file.read()
Expand Down
121 changes: 119 additions & 2 deletions zabbix/server/externalscripts/template-atos_openbmc-lld-zbxv4.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>4.4</version>
<date>2020-02-03T18:20:29Z</date>
<date>2020-02-26T13:11:04Z</date>
<groups>
<group>
<name>Templates</name>
Expand Down Expand Up @@ -2413,6 +2413,123 @@
</screen_item>
</screen_items>
</screen>
<screen>
<name>FRU</name>
<hsize>1</hsize>
<vsize>5</vsize>
<screen_items>
<screen_item>
<resourcetype>3</resourcetype>
<style>0</style>
<resource>
<key>openbmc_reader[-f={$OPENBMC}-system.json,-i=/xyz/openbmc_project/inventory/system,-p=Model]</key>
<host>Template Hw Atos BullSequanaEdge LLD</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>1</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>3</resourcetype>
<style>0</style>
<resource>
<key>openbmc_reader[-f={$OPENBMC}-system.json,-i=/xyz/openbmc_project/inventory/system,-p=Manufacturer]</key>
<host>Template Hw Atos BullSequanaEdge LLD</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>1</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>3</resourcetype>
<style>0</style>
<resource>
<key>openbmc_reader[-f={$OPENBMC}-system.json,-i=/xyz/openbmc_project/inventory/system,-p=AssetTag]</key>
<host>Template Hw Atos BullSequanaEdge LLD</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>1</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>3</resourcetype>
<style>0</style>
<resource>
<key>openbmc_reader[-f={$OPENBMC}-system.json,-i=/xyz/openbmc_project/inventory/system,-p=SerialNumber]</key>
<host>Template Hw Atos BullSequanaEdge LLD</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>1</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>3</resourcetype>
<style>0</style>
<resource>
<key>openbmc_reader[-f={$OPENBMC}-system.json,-i=/xyz/openbmc_project/inventory/system,-p=PartNumber]</key>
<host>Template Hw Atos BullSequanaEdge LLD</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>4</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>1</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
</screen_items>
</screen>
<screen>
<name>Network</name>
<hsize>3</hsize>
Expand Down Expand Up @@ -2538,7 +2655,7 @@
</screen_items>
</screen>
<screen>
<name>System</name>
<name>System Dimm</name>
<hsize>4</hsize>
<vsize>7</vsize>
<screen_items>
Expand Down
Loading

0 comments on commit 373241c

Please sign in to comment.