User Tools

Site Tools


networking:monitoring:zabbix_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
networking:monitoring:zabbix_host [2015/08/27 17:27]
jcooper created
networking:monitoring:zabbix_host [2015/12/29 11:30] (current)
gcooper
Line 1: Line 1:
-====== Zabbix NMS Notes ======+====== Zabbix NMS Host ====== 
 + 
 +See also **[[networking:monitoring:zabbix]]**
  
 **Home**: http://www.zabbix.com/ **Home**: http://www.zabbix.com/
Line 15: Line 17:
 **HowTo - Agent**: http://tecadmin.net/install-zabbix-agent-on-centos-rhel/ **HowTo - Agent**: http://tecadmin.net/install-zabbix-agent-on-centos-rhel/
  
-See also **[[networking:linux:static_ip_addr|Static IP Address]]**+===== Add a Host to Monitor =====
  
-===== Install Server =====+http://tecadmin.net/add-host-zabbix-server-monitor/
  
-<file> +https://www.zabbix.com/documentation/2.4/manual/config/hosts/host
-sudo apt-get update +
-sudo apt-get install apache2 mysql-server php5 php5-cli php5-common php5-mysql snmp snmp-mibs-downloader \ +
-  smistrip +
-reboot +
-</file>+
  
-<file> +===== Customize Trigger =====
-vim /etc/php5/apache2/php.ini+
  
-date.timezone = 'America/Phoenix' +https://www.zabbix.com/forum/showthread.php?t=19921
-</file>+
  
-<file> +Use CaseYou have a monitored device on a circuit that is having issues Rather than have constant alerts due to packet loss etcmodify the alert to minimize the churning until the circuit can be stabilized then return to the stock template.
-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 +
-</file>+
  
-<file> +  * Clone the template with the problem alert.  Use "Full Clone" to take advantage of the previous configuration.  Rename appropriately to appear next to original in template list. 
-sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent+  * Remove original template and attach new cloned template.
  
-sudo service apache2 restart +Clone Template
-sudo service zabbix-server restart +
-</file> +
- +
-<file> +
-http://<hostname or IP>/zabbix +
-</file> +
- +
-:!: 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 === +
- +
-<file> +
-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 +
-</file> +
- +
-=== Agent === +
- +
-<file> +
-vim /etc/sysconfig/iptables +
- +
--A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT +
-</file> +
- +
-<file> +
-service iptables restart +
-</file> +
- +
-==== CSF Firewall ==== +
- +
-=== Zabbix Server === +
- +
-=== Zabbix Agent === +
- +
-== csf.allow == +
- +
-<file> +
-tcp|in|d=10050|s=10.10.1.100   # From Zabbix Server +
-tcp|out|d=10051|d=10.10.1.100  # To Zabbix Server +
-</file> +
- +
-===== Agents ===== +
- +
-<note important>For normal communications (not 'active'), you must forward port 10050 on the remote NAT firewall device to the monitored host.</note> +
- +
-<note tip>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.</note> +
- +
-==== 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. +
- +
-<note important>Modify the firewall to allow incoming ''tcp/10050'' and edit the agent configuration file before starting the service.</note> +
- +
-Modify the agent configuration file: +
- +
-<file> +
-vim /etc/zabbix/zabbix_agentd.conf +
- +
-Server=<Zabbix Server IP> +
-#ServerActive=127.0.0.1 +
-Hostname=<Monitored Host ID> +
-</file> +
- +
-Configure the agent to auto-start, start the service and check the firewall: +
- +
-<file> +
-chkconfig zabbix-agent on +
-service zabbix-agent start +
- +
-ps ax|grep zabbix +
-netstat -tapn|grep 1005 +
-iptables -nL |grep 1005 +
-</file> +
- +
-=== 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'': +
- +
-<file> +
-Server=<Zabbix Server IP> +
-#ServerActive=127.0.0.1 +
-Hostname=<exact-Zabbix-host-name> +
-</file> +
- +
-In an administrative (elevated) command prompt (not PowerShell): +
- +
-<file> +
-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 +
-</file> +
- +
-=== Ubuntu === +
- +
-http://tecadmin.net/install-zabbix-agent-on-ubuntu-and-debian/ +
- +
-=== CentOS === +
- +
-http://tecadmin.net/install-zabbix-agent-on-centos-rhel/ +
- +
-== CentOS 5 x86 == +
- +
-<file> +
-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 +
-</file> +
- +
-== CentOS 6 x64 == +
- +
-<file> +
-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 +
-</file> +
- +
-:!: Modify the firewall, edit the config file then start the agent service. +
- +
-=== SME Server === +
- +
-== SME 9 x64 (CentOS 6 Base) == +
- +
-<file> +
-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 +
-</file> +
- +
-<note important>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''.</note> +
- +
-<file> +
-vim /etc/rc.local +
- +
-/etc/rc4.d/S86zabbix-agent start +
-</file> +
- +
-== SME 8 x64 (CentOS 5 Base) == +
- +
-<file> +
-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 +
-</file> +
- +
-===== 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 ====+  - Configuration -> Templates 
 +  - Click on Template with problem Trigger 
 +  - Click ''Full Clone'' 
 +  - Append text to name to be descriptive and list next to original
  
-http://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix+Remove Template and replace with clone
  
-  * Listening port is usually 161/UDP +  - Configuration -> Hosts -> Templates 
-  * Use SNMP version ''2c'' if possible +  - Click ''Unlink'' 
-    * Will show more info +  - Type the name of the new clone template in the ''Link new templates'' field and click the template 
-  ''Template SNMP Device'' will often suffice +  - Click ''Add'' 
-  * Set the community string per host +  - Click ''Update''
-    * Like a password +
-    * Defined with macro ''{$SNMP_COMMUNITY}''+
  
-=== Test Access ===+https://www.zabbix.com/documentation/2.4/manual/config/templates/template
  
-:!: ''2c'' is SNMP version.+Create/Clone the problem alert in the cloned template then modify for appropriate level
  
-<file> +:!: IE: Circuit is flaky, you know it and fix is down the road.  "Response time is too high" alert is set to trigger if over 200ms for 10 minutes and triggers several times a day.  Modify for 400ms and then when an alerts is sent there could be something to investigate.
-snmpwalk -v 2c -c <community> <remoteIP> . +
-</file>+
  
-=== Add Host ===+  - Configuration -> Host -> Triggers (on problem host)  
 +  - Disable "Problem Trigger" -> Click Problem Trigger Click ''Clone''  
 +  - Rename Problem Trigger -> Edit expression and Description Click ''Add''  
 +  - Enable new Trigger
  
-:!: 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. 
  
-{{ ::zabbix_snmp_host.png?750 |Add SNMP Host}} 
  
-===== Troubleshooting =====+==== Trigger Dependencies ====
  
-This test should connect, then close when you hit <enter>:+https://www.zabbix.com/documentation/2.4/manual/config/triggers/dependencies
  
-<file> +Sometimes the availability of one host depends on another. A server that is behind some router will become unreachable if the router goes down. With triggers configured for both, you might get notifications about two hosts down - while only the router was the guilty party. 
-telnet <IP of agent> 10050 +
-</file>+
  
-===== Zimbra ===== 
  
-https://github.com/YetOpen/zabbix-scripts/tree/master/zabbix-zimbra 
networking/monitoring/zabbix_host.1440718033.txt.gz · Last modified: 2015/08/27 17:27 by jcooper