Transcription

Monitoring Your FileMaker ServerZabbix: Full Installation from ScratchBy Wim Decorte, Senior Technical Solution Architectand Mislav Kos, Senior Technical Project LeadSoliant Consulting, Inc.July 29, 2019

Table of ContentsChoose Your Linux . 3Choose Your Location . 4Setting Up CentOS On AWS . 6SSH To Server . 8Install nano . 8SELinux Configuration Change . 9Install Zabbix . 10Install MySQL . 11Create the Zabbix Database . 13Configure Zabbix Server . 15Configure Zabbix Frontend . 19Next Steps. 24Disable MySQL Binary Logging . 24Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 2 of 26

This document is one in a series of guides that walk you throughinstalling, configuring, and using Zabbix to monitor your FileMakerservers. The full set of guides is available ix.This guide will walk you through installing Zabbix Server. These steps assume you aresomewhat proficient with Linux and the use of the command line or that you are willingto expand your skill set in this area. If this does not describe you, see the guide (2a –Zabbix as an Appliance) about using the Zabbix Server Appliance.Choose Your LinuxZabbix Server only runs on Linux, so we will have to pick a flavor of Linux we arecomfortable with that is supported by Zabbix.The Zabbix download page guides you neatly through the available choices of operatingsystems, versions of the chosen operating system, and backend-databases you wantZabbix Server to use to store its data:Figure 1. Zabbix downloadWe chose CentOS, because it is also the operating system used for FileMaker Cloud,so whatever skills we pick up working with CentOS will serve us well both in workingwith the underpinnings of Zabbix Server and FileMaker Cloud. CentOS is also theoperating system used in FileMaker Inc’s installation guide.Note that the white paper that FileMaker Inc. published with the release of FileMaker 18back in May of 2019 uses Zabbix Server version 3.x. The current version of as JulyMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 3 of 26

2019 is Zabbix 4.2 and its installation instructions are just slightly different. But the FMIguide is still a good reference1.Selecting the OS, version, and database on the Zabbix download page, update thecommand line information further down on the page that you need for the installation ofZabbix Server and its components:Figure 2. Updated command line informationThose steps assume that you already have a running Linux server of your chosenversion, so that you can copy and paste these commands into the command lineterminal. Let’s take a step back and get one up and running.There are a couple of different ways to get a running CentOS depending on whetheryou want it on-premise on physical hardware, on-premise as a virtual machine, or in thecloud.Choose Your LocationFor an on-premise install on physical hardware, you can grab the ISO installer directlyfrom https://centos.org/:1For complete reference, the official installation guide is al/installation/install from packages/rhel centosand the one that FileMaker Inc has put tween those two and this guide you are reading now, you should have all the information you need to get to asuccessful Zabbix Server installation.Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 4 of 26

Figure 3. Download CentOSYou can also use that ISO image to install it on-premise as a virtual machine. Or, if youwant to cut out a few steps, you can download a pre-built virtual machine image fromhttps://www.osboxes.org/centos.Figure 4. Pre-built virtual image from CentOSMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 5 of 26

Setting Up CentOS On AWSIf you prefer a cloud server, pre-built images are available as well in the cloud provider'smarket place. For AWS, centos.org provides an official instance for CentOS 7:Figure 5. Pre-built image for AWSThe default instance type is a t2.micro (one virtual CPU and 1GB of RAM with 8GB ofdisk space), which is very cheap and more than capable of handling a Zabbix servermonitoring multiple FileMaker Server hosts.For this guide we will use AWS, since it is easy to spin up a new instance (and abandonit) without having to make changes to our in-house infrastructure.Once you go through the few steps required in AWS to have the machine launched, youwill see it in your EC2 console. The “Name” column will be empty initially. I named itcentOS7:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 6 of 26

Figure 6. EC2 consoleThe first thing we will do is click on the security group at the bottom of that screenshot toview and update the AWS ‘firewall’ so that we can use SSH to remote into the instance.Specifically, we want to work with the “inbound rules.” By default, there will be none, sowe will add the ones that we need: Port 22 for SSH Port 10051 for incoming data from the Zabbix agents that we will deploy later Ports 80 and 443 for access to the browser-based Zabbix admin consoleMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 7 of 26

Figure 7. Set up the inbound rulesSSH To ServerAt this point, we have a working Linux server. To connect to it, open your favorite SSHclient (on macOS I am just using Terminal) and issue the proper SSH command:ssh -i /Users/wimdecorte/Documents/projects/ETS18/zabbix resources/wim ets [email protected] path to the .pem file is required by AWS to allow SSH connections. “centos” is thedefault username for CentOS, and what comes after the @ is the public IP address orDNS name of your Linux server.The first time you log in you will be asked for confirmation to connect and then will seethe command prompt of an SSH session on your Linux server.Figure 8. Command prompt of an SSH sessionInstall nanoThe very first thing we will do is install “nano,” our favorite Linux text editor.Type in:sudo yum install nanoMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 8 of 26

(yum stands for YellowDog Updater, Modified and is the CentOS default softwaremanager. It is used to install new software and system updates).As with all installations and updates, you will see a bit of an overview of what willhappen, and you will be asked to confirm with “Y” that you want to proceed:Figure 9. Type “Y” to proceedA few seconds later, we will be finished:Figure 10. Nano install is completeSELinux Configuration ChangeSecond on our to-do list is to change a security setting in CentOS’s defaultconfiguration. By default, CentOS has SELinux enabled, which will get in the way ofZabbix Server functioning properly, so we need to adjust it:Type in:sudo nano /etc/selinux/configMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 9 of 26

Change the line that starts with “SELINUX” to read “SELINUX permissive”Figure 11. Line changed to “SELINUX permissive”Press control-o and then enter to save the changes and control-x to quit the text editor.Install ZabbixNow we can go back to the instructions on the Zabbix download page that tell us how toinstall Zabbix Server:Figure 12. Install Zabbix ServerThe first set of commands is basically telling ‘yum’ where the installers are located andto clean its internal database of available software locations.Remember to run all of these commands as ‘super user’ by prefixing them with ‘sudo’.The first command will look like this:Figure 13. Prefix all commands with “sudo”Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 10 of 26

The result of running the first two commands will look like this:Figure 14. After running commands under “a. Install Zabbix repository”The third command on the Zabbix downloads page (under b) is where the actualinstallation happens:sudo yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agentThat one will run for a little while, install everything needed, and report back what it hasdone:Figure 15. Showing what has been doneInstall MySQLThe next step is to configure the underlying MySQL (c and d on the Zabbix downloadspage). But this is where the instructions may fail; MySQL is likely not installed at thispoint yet. You can try the command, but if an error comes back, follow the steps belowto install MySQL:Add the MySQL 8.0 repository to your server:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 11 of 26

sudo yum install e-el7-2.noarch.rpmThen install MySQL itself:sudo yum -y install mysql-community-serverThis one is a fairly hefty download and will take a while. After it is installed, start theMySQL service:sudo systemctl start mysqldEnable it to auto-start when the machine starts:sudo systemctl enable mysqldAt any time, you can check if MySQL is running by using this command:sudo systemctl status mysqldWhen all is well, you will see an output from that ‘status’ command, confirming MySQLis up and runningFigure 16. MySQL up and runningMySQL installs with a temporary password that we need to grab before we do anythingelse. To do this, type in:sudo nano /var/log/mysqld.logand make note that the master user is ‘root’ with the password listed there.Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 12 of 26

Figure 17. Make note of the temporary password generated for master userHit control-x to quit the text editor.Create the Zabbix DatabaseNow we are ready to resume our Zabbix installation following the step c instructions onthe Zabbix downloads page to create the required database:The first command is to enter ‘mysql mode’:sudo mysql -uroot -pAt the password prompt, use the password that you retrieved earlier. After doing so, youwill find yourself at a MySQL prompt.Figure 18. Use the temporary passwordBefore we execute the commands listed on the Zabbix page, we need to change thepassword for the root user, since that temporary password cannot be used beyond thispoint. (The commands listed in step c will fail if you try.)Type in:alter user [email protected] identified by 'someNewPassword';Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 13 of 26

The new password is in-between the single quotes. Don’t forget to add the “;” at theend. This is how MySQL knows you are done with the command.Figure 19. Temporary password is replacedNow type in (or copy/paste) the first of the three separate MySQL commands of step cto create the database named "zabbix.”Figure 20. Create the database named “zabbix”Before we do the next command, we actually have to create the Zabbix user in MySQL.Older versions of MySQL allow you to use the GRANT command to both create theuser and assign rights to that user, but that is no longer supported in newer version ofMySQL (versions 8 ).Type in the following to create a MySQL “zabbix” user with a password you specify:CREATE USER [email protected] IDENTIFIED WITH mysql native password BY‘[email protected]’;Then instead of the command shown in the Zabbix instructions, use this slightlymodified one to grant rights to the "zabbix" database for the "zabbix" user:GRANT ALL PRIVILEGES ON zabbix.* TO [email protected] WITH GRANT OPTION;Figure 21. Grant rights to the “zabbix” database for the “zabbix” userThe last command is easy and just drops out of the MySQL mode and back into Linux:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 14 of 26

Figure 22. Quit MySQL and return back into LinuxThe last item in step c is to import the schema for the "zabbix" database:sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz mysql -uzabbix -p ZabbixFigure 23. Import schema for the “zabbix” databaseNote that the password requested here is for the newly created "zabbix" user.Configure Zabbix ServerThe next step in the Zabbix instructions calls for an edit to the Zabbix config file to makesure that Zabbix knows the MySQL password for the "zabbix" user:Figure 24. Edit the Zabbix config fileType in:sudo nano /etc/zabbix/zabbix server.confto open the Zabbix configuration file and scroll down to the entry for the databasepassword:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 15 of 26

Figure 25. Scroll to entry for the database passwordRemove the “#” at the start of the line and add the password for the Zabbix MySQLuser.Figure 26. # symbol removed from start of the lineHit control-o and then enter to save the change and then control-x to quit nano.At this point, much of the heavy lifting is done; the next step listed on the Zabbixdownload page is to update the time zone that will be used by Zabbix:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 16 of 26

Figure 27. Update the time zoneType insudo nano /etc/httpd/conf.d/zabbix.confand scroll down to the time zone setting:Figure 28. Time zone settingAnd change it to your time zone. All supported time zones are listed here:https://www.php.net/manual/en/timezones.php Since we are on the East Coast, wechanged it to America/New York and removed the “#” at the start of the line:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 17 of 26

Figure 29. # symbol removed from start of the time zone lineHit control-o and then enter to save the change and control-x to exit the text editor.At this point we can start the Zabbix server so that all the changes we have made takeeffect.Figure 30. Start the Zabbix serversudo systemctl restart zabbix-server zabbix-agent httpdThis command is actually restarting three services:1. The Zabbix server2. The Zabbix agent (each Zabbix server also monitors itself)3. The web server (https)The 2nd command under step F ensures that all three of these services will auto-startwhen the machine restarts:sudo systemctl enable zabbix-server zabbix-agent httpdMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 18 of 26

At this stage you will want to confirm that all three of these services are properlyworking by running these three checks:sudo systemctl status zabbix-serversudo systemctl status zabbix-agentsudo systemctl status httpdAfter each command you should see the service “in the green” next to ‘Active’:Figure 31. Service shown in greenConfigure Zabbix FrontendGoing back to following the instructions shown on the Zabbix download page, we cannow turn our attention to the Zabbix frontend by opening it in the browser:Figure 32. Open Zabbix frontendUse the URL as indicated in your favorite browser, and you should see this:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 19 of 26

Figure 33. Zabbix frontend in browser“Next Step” brings us to an overview of the PHP pre-requisites, and if we did theinstallation correctly, everything here should be in the green:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 20 of 26

Figure 34. PHP prerequisitesThe following step is a confirmation of the Zabbix MySQL database. Enter the passwordhere for the "zabbix" user that was added earlier on.Figure 35. Enter password for the “zabbix” userMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 21 of 26

Provide a name for your Zabbix installation:Figure 36. Enter name for the Zabbix installationAnd you get one last chance to confirm all the settings:Figure 37. Pre-installation summaryMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 22 of 26

And we are done:Figure 38. Zabbix frontend installation completedNow you can log in to the Zabbix admin console. The default credentials are usernameAdmin (with a capital!) and password zabbix.Figure 39. Log into the Zabbix admin consoleMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 23 of 26

Congratulations, you have a fully functional Zabbix Server:Figure 40. Zabbix ServerNext StepsThe next guides in this series explain how to install Zabbix agents on your FileMakerServers (3 – Zabbix Agents) and how to add those FileMaker Servers as hosts tomonitor here in the Zabbix Server (4 – Zabbix Configuration).Disable MySQL Binary LoggingBut there is one more important change that we want to make to MySQL before ZabbixServer starts to collect data.We are running on an AWS t2.micro with 8GB of disk space, and at the end of theinstallation, we have just more than half of that disk space still available:To check, type the following command and look at the Use % of the root directory (/):dfMonitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 24 of 26

Figure 41. Disk space usedMySQL will collect binary logs (in folder /var/lib/mysql/) that will very quickly fill up thatdisk space. Those binary logs are only required if you intend to replicate this particularMySQL instance with others, and for our purpose, we do not. If you do want that defaultMySQL behavior, you will need to increase the disk size for this server.In our deployment we want to disable those binary logs.Type in:sudo nano /etc/my.cnfand scroll down to the section indicated in Figure 42:Figure 42. Scroll down to “# disable log bin”Remove the “#” at the start of the line so that “disable log bin” becomes active:Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 25 of 26

Figure 43. Remove the “#” from the lineHit control-o and then enter to save the changes and then control-x to quit the texteditor.Restart MySQL for the change to take effect:sudo systemctl restart mysqldOn to the next guide and installing Zabbix Agents (3 – Zabbix Agents).Monitor Your FileMaker Server – Zabbix: Full Installation from ScratchSoliant Consulting, Inc.Page 26 of 26

Jul 02, 2019 · sudo yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent That one will run for a little while, install everything needed, and report back what it has done: Figure 15. Showing what has been done Install MySQL The next step is to configure the underlying MySQL