Zabbix Installation Step:
www.zabbix.com/download
Zabbix Template:
github.com/jjmartres/Zabbix/tree/master/zbx-templates
Zabbix Web:
Configuration > Hosts > Create host:
Host name: localhost
Groups: Linux servers
Add > Items > Create item:
Name: agent.ping
Key: agent.ping
New application: availability
Add > Create item:
Name: agent.hostname
Type: Zabbix agent (active)
Key: agent.hostname
Type of information: Text
History storage period: 7d
New application: agent information
Add > Apply > No Info column = up and running
Search: localhost > Latest data > Graph:
View as: Valuesyum install zabbix_getzabbix_get -s 127.0.0.1 -k agent.pingvim /etc/zabbix/zabbix_server.confzabbix_server -R config_cache_reload > Apply changes at the very moment (Default 60 seconds)[/list]
Monitoring network equipment with SNMP:[*]yum insatll net-snmp
Is this ok [y/d/N]: y
[*]yum install net-snmp-utils.x86_64[*]snmpwalk -v2c -cmycommunity 10.10.10.1 sysDescr or
snmpwalk -v2c -cmycommunity 1.3.6.1.2.1.1.1
[*]Configuration > Hosts > Create host
Host name: gateway
Groups: Discovered hosts
Agent interfaces: Remove
SNMP interfaces: 10.10.10.1 IP 161 and Use bulk requests > Add
Items > Create item
Name: System Description
Type: SNMPv2 agent
Key: sysDescr.0
Host interface: 10.10.10.1 : 161
SNMP OID: 1.3.6.1.2.1.1.1.0
SNMP community: mycommunity
Update interval: 30s
History storage period: 3d > Add
[*]vim /etc/snmp/snmpd.conf
change community from public > mycommunity
systemctl start snmpd
systemctl status snmpd
[*]Administration > General > Drop down box: Other
Refresh unsupported items: 1m > Update[*]# zabbix_server -R config_cache_reload
[*]Configuration > Hosts > gateway Items
Status: Enabled
[*]Monitoring > Latest data
Hosts: gateway > Apply
Last value: RouterOS RB751U-2HnD
[*]Configuration > Hosts > localhost
SNMP interface > Add > Update
[*] localhost Items > Create item
Name: System Description
Type: SNMPv2 agent
Key: sysDescr.0
SNMP OID: 1.3.6.1.2.1.1.1.0
SNMP community: mycommunity
Type of information: Text
History storage period: 3d > Add
[*]# zabbix_server -R config_cache_reload
[*]Monitoring > Latest data
Hosts: localhost > Apply
Last value: Linux zabbix 3.10.0-862.14...
[*]www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/snmp
[/list]
Integrating own script into Zabbix and use it as an item:
- # vim /ect/zabbix/zabbix_server.conf
ExternalScripts=/usr/lib/zabbix/externalscripts
:q
- # cd /usr/lib/zabbix/externalscripts
- ll
- vim echo.sh
#!/bin/bash
ARG=$1
if $ARG -eq 1
then
echo -e "one";
elif $ARG -eq 2
then
echo -e "two";
else
echo -e "nodata";
fi
- ./echo.sh
nodata
./echo.sh 1
one
./echo.sh 2
two
- Configuration > Hosts > localhost Items > Create item
Name: Echo 1, 2, nodata
Type: External check
Key: echo.sh["1"], ["2"], []
Type of information: Text
History storage period: 1d > Add
- Monitoring > Latest data
Echo 1: Last value: one
Echo 2: two
Echo nodata: nodata
- www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/external
Monitoring hosts without SNMP or Zabbix agents. Create ICMP echo tests:
- Configuration > Hosts > localhost Items > Create item
Name: Gateway HTTP reachability
Type: Simple check
Key: Select > net.tcp.service[service,,] > [http,10.10.10.1,80]
History storage period: 1d
Trend storage period: 1w > Add
- Create item
Name: ICMP ping
Type: Simple check
Key:
Select >
icmppingloss[,,,,]
> [10.10.10.1,5,20(ms),40(byte),200]
Type of information: Numeric (float)
Units: %
History storage period: 1d
Trend storage period: 1w > Add
- Monitoring > Latest data
Gateway HTTP reachability Last value: 0 > can't reach with port 80
ICMP ping Last value: 0 % > No loss
- www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/simple_checks
How preprocessing works and its capabilities. Configuring preprocessing:
- localhost > System Description > Clone
Name: Kernel version
Key: kernel.version > Preprocessing > Add
Name: Regular expression
Parameters: (s[0-9].*x86_64s)
output: kernel is 1 > Add
- # zabbix_server -R config_cache_reload
- Monitoring > Latest data
Hosts: localhost > Apply
Kernel version Last value: kernel is 3.10.0-862.14.4.el7.x86_64
- gateway Items > Create item
Name: wlan1 incoming traffic
Type: SNMPv2 agent
Key: wlan1.traffic.in
SNMP OID: interfaces.ifTable.ifEntry.ifInOctets.6
SNMP community: mycommunity
Units: bps
History storage period: 3d
Trend storage period: 1w > Preprocessing > Add
Name: Customer multiplier, Parameters: 8 > Change byte to bit > Add
Name: Change per second > Add
- # zabbix_server -R config_cache_reload
- Monitoring > Latest data
Hosts: gateway > Apply
wlan1 incoming traffic Last value: 1.18 Kbps
- www.zabbix.com/documentation/4.0/manual/appendix/items/preprocessing?s[]=preprocessing