Author Topic: Zabbix 3.2.6 installation and configuration on esx(i) 6.5  (Read 857 times)

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
As posted on FB, working on this guide and would love a way to collaborate, so creating this post with this intent.

Initially here and when the final doc is ready, we can move to a How To section.

I'll be posting the document on-line at onedrive as I don't use it and all space is available. I'll post the link when it is there.
« Last Edit: June 08, 2017, 11:57:42 PM by melloa »


Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #2 on: June 09, 2017, 12:23:25 AM »
P.S. For obvious reasons, suggestions and changes should be submitted as posts on this thread.
P.S. 2. Going forward I'll post in pdf format, so people will be less concerned ... but wait ... I also can send virus inside a pdf  ::)

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #3 on: June 09, 2017, 01:54:52 AM »
Today's: https://1drv.ms/b/s!AsAq2Gec9J71liVjEb4WqneLrGwF

Tomorrow will continue with Edd's instructions for Discovery.

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #4 on: June 09, 2017, 05:27:31 AM »
I had some extra time: https://1drv.ms/b/s!AsAq2Gec9J71lid2xLidJdi_sbU6

Edd,

Got lost here:

Link to templates: Template App Zabbix Agent
Enable host
Set host inventory mode: Automatic

Offline noman

  • Administrator
  • Newbie
  • *****
  • Posts: 27
  • Karma: +2/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #5 on: June 09, 2017, 08:46:47 AM »
These are good instructions, but you are missing a whole lot of Zabbix configurations in between setting a new system password and accessing the webgui, I have alot of this wirtten up in a document here as generic notes, but ost of that information is also found in the documentation: https://www.zabbix.com/documentation/3.2/manual/appliance

This is what I have so far for zabbix installation, there are missing a few pices and nmap and sudo access but that is easy added on a later stage

Zabbix Installation
Download ISO file from: https://sourceforge.net/projects/zabbix/
Latest version in time of writing is: 3.2.6
Latest version is based on a customized Ubuntu 14.04 release
Install server whit mysql option (would love a nginx and mariadb version), follow the onscreen instructions
Systems default credentials are:
Core Server System:
User: appliance  \ Password: zabbix
Database:
User: root  \ Password: <random>
User: zabbix  \ Password: <random>
Database passwords are randomly generated during the installation process.
Root password is stored to /root/.my.cnf file, it is not required to input a password under the “root” account.
To change the database user password it has to be changed in the following locations:
MySQL;
/etc/zabbix/zabbix_server.conf;
/etc/zabbix/web/zabbix.conf.php.
Zabbix frontend WebGUI
User: Admin  \ Password: zabbix

Login to system shell and get root access and change the root password; User: appliance  \ Password: zabbix
sudo –I
this changes your user appliance into the root user
passwd
this lets you change the password of the current user, now you have gotten your root password set to something known, I recommend setting a strong password as root user have full access to your server and it should not be trivial to get a hold of
I like to work from a SSH connection so edit /etc/ssh_config and /etc/sshd_config to allow root to access the system from a SSH tunnel at least until you are done making changes to the core system
In /etc/ssh_config I have the default settings except
# PasswordAuthentication yes  is changed to PasswordAuthentication yes
added the line: PermitRootLogin yes
Save and exit
In /etc/sshd_config I have the default settings except
# Authentication:
LoginGraceTime 360
PermitRootLogin yes
StrictModes yes
Save and exit
Now restart SSH server whit command: service ssh restart
when this is done open your favorite terminal or console and connect to your server I like to use Putty  - http://www.putty.org/
Now if you are like me and are running Zabbix Server as a VM the next thing you would like to do is install the VM drivers and toolkits so that you get better performance of your monitoring VM
For VM’s running on a vmware platform the commands are as following:
apt-get update  or sudo apt-get update  if you are not at root level
apt-get install open-vm-tools  or sudo apt-get install open-vm-tools  if you are not at root level
reboot or sudo reboot if you are not at root level
For VM’s running on VirtualBox platform the commands are as following:
apt-get update  or sudo apt-get update  if you are not at root level
apt-get install build-essential module-assistant or sudo apt-get install build-essential module-assistant if you are not at root level
m-a prepare or sudo m-a prepare if you are not at root level

Now click "Devices > Insert guest additions CD image" in the virtualbox window. This will insert the guest additions cd image into the guest OS
The cd-image should be located on the path /media/root/VBOXADDITIONS_X.X  or /media/appliance/VBOXADDITIONS_X.X   depending on what user level you are at
Navigate to the directory and run the script named VBoxLinuxAdditions.run
cd /media/root/VBOXADDITIONS_X.X or cd /media/appliance/VBOXADDITIONS_X.X
./VBoxLinuxAdditions.run or sudo ./VBoxLinuxAdditions.run if you are not at root level
When it is done you should see the following line:
Building the VirtualBox Guest Additions kernel modules ...done.
reboot or sudo reboot if you are not at root level
After the server has rebooted we want to change some of the system settings to match our environment and location, this includes timesync, zoneinfo, dns
Check that you have the correct nameservers and dns server specified for your server so that zabbix is able to resolve IP’s into hostnames this is done by editing  /etc/resolv.conf

nameserver 10.99.99.1
nameserver 192.168.55.254
search vmlab.lan
search qnett.lan
This tells the Zabbix server that my dns server is at IP 10.99.99.1 and that my domain is vmlab.lan, if you have a router whit dhcp your server should have gotten this information automaticly, if you would like to add a custom server you just enter each value as its own line.
Now to change the zoneinfo and localization of the server this is done by editing the /etc/localtime file this is done by copying the right zone file over
The zone files are located under: /usr/share/zoneinfo/
/usr/share/zoneinfo /Africa
/usr/share/zoneinfo /America
/usr/share/zoneinfo /Asia
/usr/share/zoneinfo /Europe
In my case I would have to set it to /usr/share/zoneinfo /Europe/Oslo as I am in Norway
cp /usr/share/zoneinfo/Europe/Oslo  /etc/localtime
You would need to select the city closest to your location

Now we need to change the default Zabbix timezone as it it hardcoded to be Europe/Riga this is done by editing the file /etc/apache2/conf-available/zabbix.conf
As per default it will try to synchronize its clock whit the Ubuntu servers, but we would like to synchronize it whit our local time servers so all the systems in our data-center keep the same time, as this is very important for monitoring, logs and reporting purposes we need to install NTP services as this is not installed whit the zabbix installer iso
sudo apt-get update
sudo apt-get install ntp
If you have followed some of my other guides you might recall that I configured my pfSense firewall to act as a local time server for my local network, and I want the zabbix server to get its time synced from that pfSense firewall like any other device
To do this we need to edit the file /etc/ntp.conf
# Specify one or more NTP servers.
server 10.99.99.1 prefer iburst
server pfsense.vmlab.lan prefer iburst
server 0.no.pool.ntp.org
server 1.no.pool.ntp.org
server 2.no.pool.ntp.org
server 3.no.pool.ntp.org
As you can see I have set it to prefer my local pfSense firewall whit both IP and DNS and then added the Norwegian servers of the ntp.org project this is incase my ntp server running at the firewall could have issues one day and it would then fall back to use close external timeservers so it does not lose its time configuration
Now restart NTP whit command: sudo service ntp restart
Test that NTP is working correctly:  watch ntpq -cpe –cas
More information about ntp on Ubuntu servers are here: https://blogging.dragon.org.uk/setting-up-ntp-on-ubuntu-14-04/
When the server is rebooted navigate to its webgui and login whit Admin:zabbix
We want to configure 3 things on the server, which is Host Group, Discovery rules and Action rules
Host Group: This is just a sorting group and serves no other purpose than labeling and sorting different type of devices and servers so you can apply different monitoring rules and parameters to different Host Groups
Discovery Rules: These are the rules that you create that define how and where the Zabbix Server should look for network devices and servers, in short here is where you define the rules for SNMP, PING or Zabbix Client.
Action Rules: These are the rules that says what should happen whit newly discovered devices and servers, should they be added to a Host Group, and should they be assigned a monitoring pattern based of what type of device that were detected whether it is a router or switch using SNMP or a Windows Domain Controller responding to PING or Zabbix Client installed.
This is the very basic configuration needed to get the monitoring going on Zabbix
Navigate to Configuration -> Host Groups -> Create new Host Group
I create the following 3 Host Groups
myNetwork.Zabbx
myNetwork.SNMP
myNetwork.PING
Navigate to Configuration -> Discovery -> Create Discovery rule
I create the following 3 Discovery rules
Discovery.Zabbix
Discovery.SNMP
Discovery.PING
Discovery.Zabbix
Name: Discovery.Zabbix
Discovery by proxy: No Proxy
IP range: 10.99.99.0-254
Delay (in sec): 3600
Checks:  Zabbix agent – default values, key= system.uname
Device uniqueness criteria: IP address
Enabled: NO (unchecked)

Discovery.SNMP
Name: Discovery.SNMP
Discovery by proxy: No Proxy
IP range: 10.99.99.0-254
Delay (in sec): 3600
Checks:  SNMPv1 agent and SNMPv2 agent – default values
Device uniqueness criteria: IP address
Enabled: NO (unchecked)
Discovery.PING
Name: Discovery.PING
Discovery by proxy: No Proxy
IP range: 10.99.99.0-254
Delay (in sec): 3600
Checks:  ICMP Ping
Device uniqueness criteria: IP address
Enabled: NO (unchecked)
Navigate to Configuration -> Action -> Event source: Discovery -> Create Action
Here I create 3 new Action rules
Auto.Discovery.Zabbix
Auto.Discovery.SNMP
Auto.Discovery.PING
Auto.Discovery.Zabbix
Action:
Name: Auto.Discovery.Zabbix
Type of calculation: And/Or
Conditions:
A   Discovery check = Discovery.Zabbix: Zabbix agent "system.uname”
B   Host IP = 10.99.99.0-254
Enable: Yes (checked)
Operation:
1. Send message about new device
2. Operation details:
Add to host groups: myNetwork.Zabbx
Link to templates: Template App Zabbix Agent
Enable host
Set host inventory mode: Automatic
Auto.Discovery.SNMP
Action:
Name: Auto.Discovery.SNMP
Type of calculation: And/Or
Conditions:
A   Discovery check = Discovery.SNMP: SNMPv1 agent "zabbix"
B   Discovery check = Discovery.SNMP: SNMPv2 agent "zabbix"
C   Host IP = 10.99.99.0-254
Enable: Yes (checked)
Operation:
1. Send message about new device
2. Operation details:
Add to host groups: myNetwork.SNMP
Link to templates: Template SNMP Device, Template SNMP Disks, Template SNMP Generic, Template SNMP Interfaces and Template SNMP Processors
Enable host
Set host inventory mode: Automatic
Auto.Discovery.PING
Action:
Name: Auto.Discovery.PING
Type of calculation: And/Or
Conditions:
A   Discovery check = Discovery.PING: ICMP ping
B   Host IP = 10.99.99.0-254
Enable: Yes (checked)
Operation:
1. Send message about new device
2. Operation details:
Add to host groups: myNetwork.PING
Link to templates: Template ICMP Ping
Enable host
Set host inventory mode: Automatic
Navigate to Configuration -> Discovery
Now you can enable the following rules
Discovery.Zabbix
Discovery.SNMP
Discovery.PING

When these rules are enabled let it run for a couple of hours as scanning the network for all your devices will take some time depending on your network layout, how many devices that are on it and the hardware of your Zabbix Server


Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #6 on: June 09, 2017, 11:36:44 AM »
Edd,

These are good instructions, but you are missing a whole lot of Zabbix configurations in between setting a new system password and accessing the webgui, I have alot of this wirtten up in a document here as generic notes, but ost of that information is also found in the documentation: https://www.zabbix.com/documentation/3.2/manual/appliance

I'll add the missing parts, but basically what I saw missing are: ssh setup, some passwords, vmware tool, and time zone.

I'm still lost on:

Link to templates: Template SNMP Device, Template SNMP Disks, Template SNMP Generic, Template SNMP Interfaces and Template SNMP Processors
Enable host
Set host inventory mode: Automatic

Where are you configuring that?

Offline noman

  • Administrator
  • Newbie
  • *****
  • Posts: 27
  • Karma: +2/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #7 on: June 09, 2017, 01:45:59 PM »
Navigate to Configuration -> Action -> Event source: Discovery -> Create Action -> Operation, see the fb post for screenshot mr. Hill asked about the same yesterday

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #8 on: June 09, 2017, 07:09:25 PM »
ah ... Configuration > Actions > Operations > Operation Type = Link to Template > Select templates.

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #9 on: June 10, 2017, 12:29:21 AM »
v. 0.03 on-line for your review: https://1drv.ms/b/s!AsAq2Gec9J71ligYOONfQnI7GyJL

Offline noman

  • Administrator
  • Newbie
  • *****
  • Posts: 27
  • Karma: +2/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #10 on: June 10, 2017, 05:42:13 PM »
Looks good so far, but we should add a note that zabbix client or snmp needs to be installed \ configured on the server and devices before the discovery rules are enabled, otherwise it will only be detected by the Ping rule, and the monitoring will be does it respond to ping every x seconds (I added the Ping rule as a catch all other devices so that you know what devices that need some extra attention)

Also I would recommend to disable the Admin user and create your own user for login even tho you have changed the password and you trace the logs and it says admin did the change, not Mello or Noman in the logs, since this is a enterprise level software it should have a note about that.

We should also add in setting up the email and sms alerting before creating the discovery rules, whit is the point of having a monitoring system without getting alerted when it is triggered ?

This is just some of the thougts I have from laying sick in beed whit my laptop

Offline melloa

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Zabbix 3.2.6 installation and configuration on esx(i) 6.5
« Reply #11 on: June 12, 2017, 03:09:20 PM »