If you are a regular SSH user, there are chances that you sometimes faced the error message “Connection reset by peer”. To avoid this message, you can edit some settings on server side or on client side. In this post I will show you both case.
If you are using Putty, there is a setting under the “Connection” tab that allow you to set the keepalive value. By default it’s disabled (value is 0).
You can set the value at 240 and each 240 seconds, Putty will send a null packets to keep the connection open.
So it was an opportunity to rewrite my monitoring script from scratch. It’s now time to share it with you. If you want more information about the purpose, the way I’ve made the integration, etc. don’t hesitate to read my previous post as the only modifications are the code and the type of information the script can gather from the array.
Instead of writing a script for each part of the monitoring (volumes, array, disks,…), I’ve put everything in one file called “PureStorageMonitoring.py”. The dependencies are still the same : purestorage and urllib3 libraries from Python and Python 3.x
A complete list of datas and triggers that will be gathered by the script is available at the end of this post.
Important note : This script has been tested with Zabbix 3.4.x and 4.0.x and Pure Storage 4.10.8 (REST API version 1.12). I cannot guarantee that it will work fine with any other version even if I made my best regarding this point. The template available is exported from Zabbix 4.0.x so you will have to delete some settings to import it in Zabbix 3.4.x don’t hesitate to contact me in case of trouble.
Setup the proxy or server
To gather data, we need to make some works on the Zabbix Proxy or Zabbix Server.
Be sure that you have Python 3.x installed on the server
Install the pip packages
pip3 install purestorage urllib3 py-zabbix
Get API Token
To be able to use the REST API of Pure Storage, you have to find your API Token on the web interface. Go on “SYSTEM”, then “Users” and under the Users menu, you will find “API Tokens”. Click on the three dots on the right of the screens and use “Show API Token” to get your API Token.
Download the scripts
The script is available on my Github repository. You can download it on the server using the following steps :
Find the directory where you have to download it, by looking at the value of “ExternalScripts” setting of your proxy or server (by default it’s “/usr/local/share/zabbix/externalscripts” but if like me you are using the official Debian packages from Zabbix, it will be “/usr/lib/zabbix/externalscritps”
To be able to give information about this POC to everybody inside the team, we needed a dashboard. So with the help of Flash Array Rest API, Zabbix and Grafana, I produced this dashboard :
Please, bear in mind : These scripts and the Zabbix template are a "Work in progress". Currently we are on a POC and not yet in production so other elements will be added (triggers, items, etc.) and this post will be updated.
The Zabbix integration is made of :
Python scripts and libraries
FlashArray Rest API
Zabbix Sender (with Trapper items)
Zabbix ExternalScripts (executed on Zabbix Server or Proxy)
There are four scripts :
How it works
There are two parts in the Zabbix template :
The LLD_PureVolume.py is responsible of the discovery rule. Zabbix will use it to get the list of existing volumes on the FlashArray and will create the corresponding items. The PureArrayInfo.py and PureArrayMonitor.py are responsible of gathering the data from the Array point of view. The PureVolumeMonitor.py is responsible of gathering data from the volume point of view using the items that will be created by the discovery rules. As all the data are in the same JSON output when we query the FlashArray API, the scripts will gather all information at the same time and will use the Zabbix Sender to populate all the Trapper items at each execution instead of launching the scripts for each items. The scripts will return “1” at the end and store it in an item called “Pure Array Info Launch”,”Pure Array Monitoring Launch” or “VolumeName Monitoring Launch”.
Important note : We are using Zabbix 3.4.x. So you could face some problems while importing the template. Let me know if it’s the case.
Before we start with the integration into Zabbix, be sure to have the following tools installed on your Zabbix Proxy or Server :
purestorage and urllib3 libraries You can install them on your system by running the following command :
pip install purestorage urllib3
or (if your default Python version is not Python 3.x)
Before going further, you will need to gather the following information from your Pure Storage FlashArray :
To get the API Token, open your Flash Array web interface and go on "API Tokens" menu under the "Users" menu that you will find in the "SYSTEM" tab.
You will see a list of users and three dots on the right of the screen. Click on it and finally select "Show API Token"
If your system is ready and you have all the information at hand, let's start the integration on your system.
Download the scripts and the template
All the scripts and template are available on my GitHub repository. Download all those files and put the scripts on your ExternalScripts directory on your Zabbix Proxy or Server. By default this directory is : /usr/local/share/zabbix/externalscripts but check your Zabbix configuration file if you have any doubt. By example, we are using the official Zabbix packages for Debian and this directory is /usr/lib/zabbix/externalscripts
Set the good rights
To allow Zabbix to execute those scripts you must allow them to be executed and owned by the Zabbix user on your system. You can execute the following commands (under the ExternalScripts directory) :
If you are a Synology NAS user, maybe you want to read some logs to understand what’s happened when you face a problem.
There are two ways to do that :
Using Log Center package
Using Support Center
If you want to read logs about backup, user connection, etc. the first solution should be quite good but if you are looking for more specific logs about a system problem, slowness, etc. the second solution will give you more details.
To export logs from Support Center, follow those steps :
Open Support Center from Synology menu
Go to “Support Services” tab and in the “Log Generation” menu, select the logs that you want to check, then click “Generate logs”
Wait a few minutes while your NAS is generating the logs
The file generated by the NAS will be named “debug.dat“, you can open it using 7-Zip.
In the file you will find a directory named “dsm“, all the primary logs will be under the directory hierarchy : “dsm -> var -> log”
At the company I work for, we are using Zabbix to monitor our infrastructure and in some case we are using “traceroute” to keep an eye on our network from different locations.
By keeping a traceroute history, it can help you to understand some networking problem by example when you are facing packet loss from some location.
To keep this history in Zabbix, we are using “MTR” instead of the traditional “traceroute” command.
Here is a small explanation of what MTR is, taken from the Github page of the project :
mtr combines the functionality of the ‘traceroute’ and ‘ping’ programs in a single network diagnostic tool.
As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence of ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine.
Here is an example of the command output :
MTR is installed on our Zabbix proxies and on the main server.
Under Debian, the command to install MTR is :
sudo aptitude install mtr
As we are using proxies and active agents, the remote commands are not supported. So we have deployed a local script on the server and proxies.
Here is the local script :
mtr -r -c3 -w -b $IP
This local script is named “mtrtrace.sh” and is saved under the “externalscripts” directory of Zabbix. The path can be found in the proxy or server configuration file under the following configuration key : “ExternalScripts“. Under Debian it’s “/usr/lib/zabbix/externalscripts“.
Once you have created the file, you have to allow Zabbix to execute it by using the following commands :
If you prefer to add it in an existing template, here are the settings :
It will use the first ” IP address” in the “Agent interfaces” part of the host configuration.
You will find the history of data under the application “Traceroute” and in the item ” MTR Trace” on the “Latest data” tab of the configured host.
Here is an example of data from this tab :
Please note that, it’s recommended to increase the “Timeout” value in the Zabbix Server and Proxies configuration files to use this script. On my side it takes 10 seconds in average to be completely executed.
A few weeks ago, I was writing about the availability of Veeam Backup & Replication 9.5 Update 1 RC and the way to get it. Today, you can get the official release from Veeam website. After the upgrade, your build version will be 22.214.171.1243. Before making this upgrade, be sure that you are running build 126.96.36.1990, 188.8.131.521 or 184.108.40.2062.
VMware vSphere 6.5 support
Encrypted VMs support
Virtual hardware version 13 support
NBD compression (you will have to change a registry key to manage it, see the release note for more information)