====== Zabbix NMS Notes ======
See also **[[networking:monitoring:zabbix_host|Add a Zabbix Host to Monitor]]**
See also **[[networking:linux:static_ip_addr|Static IP Address]]**
**Home**: http://www.zabbix.com/
**Downloads**: http://www.zabbix.com/download.php
**Documentation**: https://www.zabbix.com/documentation/2.4/manual/installation/requirements
**Wiki**: http://www.zabbix.org/wiki
**Forums**: https://www.zabbix.com/forum/
**HowTo - Server**: http://tecadmin.net/install-zabbix-on-ubuntu/
**HowTo - Agent**: http://tecadmin.net/install-zabbix-agent-on-centos-rhel/
===== Install Server =====
sudo apt-get update
sudo apt-get install apache2 mysql-server php5 php5-cli php5-common php5-mysql snmp snmp-mibs-downloader \
smistrip nmap traceroute
reboot
vim /etc/php5/apache2/php.ini
date.timezone = 'America/Phoenix'
wget http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.4-1+trusty_all.deb
sudo dpkg -i zabbix-release_2.4-1+trusty_all.deb
sudo apt-get update
sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
echo "zabbix ALL=(ALL:ALL) NOPASSWD:/usr/bin/nmap" >> /etc/sudoers
sudo service apache2 restart && sudo service zabbix-server restart
http:///zabbix
:!: For the **database** step, use the dbname, username and password you created during install (e.g. ''zabbix'', ''zabbix'' and the password you created).
:!: The **default credentials** are ''admin'' and ''zabbix''. **Change the ''admin'' password!**
===== Firewall =====
Zabbix communications are all **TCP** based by default. They are configurable in the ''zabbix_agentd.conf'', for the Agent, and ''zabbix_server.conf'' for the server.
:!: If you change the port in the ''zabbix_agentd.conf'' file, you will also need to change the specific host entries in the UI.
^ Port ^ Note ^
|162 |For Server, SNMP, Server Inbound |
|161 |For Server, SNMP, Server Outbound |
|10050 |For Agent, Server To Agent port, Server Outbound |
|10051 |For Server, Agent To Server port, Server Inbound |
:!: The server runs an agent too, so we allow both.
==== IPtables Firewall ====
=== Server ===
vim /etc/sysconfig/iptables
-A INPUT -p udp -m udp --dport 162 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT
=== Agent ===
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
service iptables restart
==== CSF Firewall ====
=== Zabbix Server ===
=== Zabbix Agent ===
== csf.allow ==
tcp|in|d=10050|s=10.10.1.100 # From Zabbix Server
tcp|out|d=10051|d=10.10.1.100 # To Zabbix Server
===== Agents =====
For normal communications (not 'active'), you must forward port 10050 on the remote NAT firewall device to the monitored host.
If you have multiple monitored hosts behind a remote NAT firewall, you must use Active mode on the agent or (on the remote NAT firewall device) forward additional ports (10051, etc.) in to port 10050 of the additional monitored hosts and adjust the ports defined for the additional monitored hosts in the Zabbix web interface.
==== Active Agents ====
https://support.opennodecloud.com/wiki/doku.php?id=usrdoc:os:zabbix
* Active agents initiate all communications to server
* No port forwarding required at client
* Multiple monitored hosts behind remote NAT firewall
* Lower resource utilization on server
* Modify the host on server
* IP address must be set to ''0.0.0.0''
* All ''Items'' must be configured as ''Zabbix Agent (active)''
* Generally by cloning templates
* See link above
* The configuration file is slightly different
* Set ''ServerActive'' to the IP address of the Zabbix server
==== Install Agents ====
:!: Install the ''zabbix-agent'' on the Zabbix server as well.
Modify the firewall to allow incoming ''tcp/10050'' and edit the agent configuration file before starting the service.
Modify the agent configuration file:
vim /etc/zabbix/zabbix_agentd.conf
Server=
#ServerActive=127.0.0.1
Hostname=
Configure the agent to auto-start, start the service and check the firewall:
chkconfig zabbix-agent on
service zabbix-agent start
ps ax|grep zabbix
netstat -tapn|grep 1005
iptables -nL |grep 1005
=== Windows ===
http://tecadmin.net/install-zabbix-agent-windows-system/
http://www.zabbix.com/downloads/2.4.4/zabbix_agents_2.4.4.win.zip
Download and extract the Windows agent to ''C:\Support''.
:!: You can use ''Wordpad'' as the editor, but turn word-wrap off. Use ''Notepad'' thereafter.
Edit ''C:\Support\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf'':
Server=
#ServerActive=127.0.0.1
Hostname=
In an administrative (elevated) command prompt (not PowerShell):
cd C:\Support\zabbix_agents_2.4.4.win\bin\win64
.\zabbix_agentd.exe --config C:\support\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf --install
net start "Zabbix Agent"
sc config "Zabbix Agent" start= auto
netsh advfirewall firewall add rule name="Zabbix Agent" dir=in action=allow protocol=TCP localport=10050
== Uninstall ==
net stop "Zabbix Agent"
cd C:\Support\zabbix_agents_2.4.4.win\bin\win64
.\zabbix_agentd.exe --config C:\support\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf -d
netsh advfirewall firewall delete rule name="Zabbix Agent"
=== Ubuntu ===
http://tecadmin.net/install-zabbix-agent-on-ubuntu-and-debian/
=== CentOS ===
http://tecadmin.net/install-zabbix-agent-on-centos-rhel/
== CentOS 5 x86 ==
rpm -Uvh http://repo.zabbix.com/zabbix/2.4/rhel/5/i386/zabbix-release-2.4-1.el5.noarch.rpm
yum install zabbix zabbix-agent
== CentOS 6 x64 ==
rpm -Uvh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
yum install zabbix zabbix-agent
:!: Modify the firewall, edit the config file then start the agent service.
=== SME Server ===
== SME 9 x64 (CentOS 6 Base) ==
config set zabbix-agent service TCPPort 10050 access public status enabled
signal-event remoteaccess-update
rpm -Uvh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
mv /etc/yum.repos.d/zabbix.repo /etc/yum.smerepos.d/
yum install zabbix zabbix-agent
chkconfig zabbix-agent on
/etc/init.d/zabbix-agent start
If you have problems getting the agent to auto-start after a reboot, a quick way to fix is to add a line to ''rc.local''.
vim /etc/rc.local
/etc/rc4.d/S86zabbix-agent start
== SME 8 x64 (CentOS 5 Base) ==
config set zabbix-agent service TCPPort 10050 access public status enabled
signal-event remoteaccess-update
rpm -Uvh http://repo.zabbix.com/zabbix/2.4/rhel/5/x86_64/zabbix-release-2.4-1.el5.noarch.rpm
mv /etc/yum.repos.d/zabbix.repo /etc/yum.smerepos.d/
yum install zabbix zabbix-agent
chkconfig zabbix-agent on
ln -s /etc/rc.d/init.d/zabbix-agent /etc/rc7.d/S87zabbix-agent
service zabbix-agent start
===== Add a Host to Monitor =====
http://tecadmin.net/add-host-zabbix-server-monitor/
https://www.zabbix.com/documentation/2.4/manual/config/hosts/host
==== SNMP ====
http://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix
* Listening port is usually 161/UDP
* Use SNMP version ''2c'' if possible
* Will show more info
* ''Template SNMP Device'' will often suffice
* Set the community string per host
* Like a password
* Defined with macro ''{$SNMP_COMMUNITY}''
=== Test Access ===
:!: ''2c'' is SNMP version.
snmpwalk -v 2c -c .
=== Add Host ===
:!: Set the SNMP community string (like a password) for each host by adding a **macro** ''{$SNMP_COMMUNITY}'' with the value being the community string for the host to be monitored.
{{ :networking:monitoring:zabbix_snmp_host.png?750 |Add SNMP Host}}
=== Mikrotik ===
https://github.com/YSmetana/zabbix-mikrotik-snmp
- In Zabbix, Add a Host
- Add a host group too, if not already created
- Use UDP port 161
- Assign the SNMP IP address and community string
- 'public' may be OK if no external access
- Otherwise, assign another community string
- A community string is a bit like a 'password'
===== Troubleshooting =====
This test should connect, then close when you hit :
telnet 10050
:!: When **importing templates**, be sure to import the **'raw'** or pure XML file, not an HTML file from a web page.
===== Zimbra =====
https://github.com/YetOpen/zabbix-scripts/tree/master/zabbix-zimbra