รวมประเภทของ Program ต่างๆ ว่าใช้งานอะไรบ้าง !!!

PlAwAnSaI

Administrator
  • เก็บข้อมูลปริมาณการใช้งานระบบเครือข่าย, เก็บและวิเคราห์ Log ต่างๆ , ใช้วิเคราะห์ปริมาณการใช้งานทรัพยากรต่างๆ ทั้งของ Server
    www.thaiadmin.org/board/index.php?topic=95033
  • www.coimbatorewebhosting.com/blog/how-to-install-zabbix-on-centos
What is ZABBIX ?:The Enterprise-class Open Source Network Monitoring Solution:
  • 1998 - started as an internal project in a bank
  • April, 2001 - first release of Zabbix 1.0 alpha 1
  • 12 November, 2013 - Zabbix 2.2 LTS
  • 16 February, 2016 - Zabbix 3.0 LTS
  • 21 August, 2017 - Zabbix 3.4
  • 1 October, 2018 - Zabbix 4.0 LTS
Zabbix release a stable version every one and a half year that means that stable release means that this release will be supported for five years.Zabbix Components:
  • Zabbix agent
  • Zabbix server
  • Zabbix proxy
  • Jave Gateway
  • Zabbix frontend
  • Zabbix database
Operating Systems Support:
  • Linux
  • FreeBSD
  • NetBSD
  • IBM AIX
  • IBM Power8
  • OpenBSD
  • HP-UX
  • Mac OS X
  • Solaris
  • Windows (Only Agent)
Database Support:
  • MariaDB
  • MySQL
  • SQLite
  • PostgreSQL
  • Oracle DB
  • IBM DB2
  • Elasticsearch
www.zabbix.com/aboutCapabilities and system requirements:System Requirements:
  • 128MB physical memory
  • 256MB disk space
  • the more you store - the more space you need
  • Small - CentOS - Virtual Appliance - MySQL InnoDB > Monitored 100 hosts
  • Medium - CentOS - 2 CPU cores/Memory 2GB - MySQL InnoDB > 500 hosts
  • Large - RedHat Enterprise Linux - 4 CPU cores/8GB - RAID10 MySQL InnoDB or PostgreSQL > >1,000 hosts
  • Very large - RedHat Enterprise Linux - 8 CPU cores/16GB - Fast RAID10 MySQL InnoDB or PostgreSQL > >10,000 hosts
www.zabbix.com/documentation/4.0/manual/installation/requirementsCapabilities:
  • Millions of metrics per second
  • Active/Passive approach
  • 100,000 of hosts
  • Customization
  • Network discovery
  • VPS, container, application, server, network infrastructure and etc. monitoring
  • ZBX/SNMP/JMX/IPMI
  • API
  • Personal dashboards
  • Encryption
  • Maps
  • Grouping and templating
  • Prediction
  • Severity levels
What To Start With ?:Important:
  • Look after NVPS as you grow
  • Set history and trends period large if it is really needed
  • Don't query too often
  • Look after disk space
  • Set up Zabbix internal alerts
  • Add pollers as you grow
  • Delete unnecessary data
  • Install components on separate machines if possible
Active Monitoring VS. Statistics:
  • Statistics for time to time reference or post-incident analysis
  • Active monitoring - notify about the incident
What If Don't Know The Solution:
  • www.zabbix.com/forum
  • zabbix.org/wiki/Main_Page
  • share.zabbix.com
  • www.zabbix.com/documentation/4.0/manual
Installation:
  • [root@zabbix]# cat zabbix.repository
  • ก่อนการติดตั้้ง Zabbix จะต้อง Configure ค่า Zabbix RPM Repository ดังนี้:
    root@zabbix]# rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
  • oot@zabbix]# yum --enablerepo="base" -y install yum-utils
  • ot@zabbix]# yum-config-manager --enable rhel-7-server-optional-rpms
  • ติดตั้ง Zabbix Server กับ MySQL:
    t@zabbix]# yum install zabbix-server-mysql zabbix-web-mysql mariadb-server
    Is this ok [y/d/N]: y
  • @zabbix]# systemctl enable mariadb
  • zabbix]# systemctl start mariadb
  • ทำการตั้งค่าเริ่มต้นของ MySQL:
    abbix]# mysql_secure_installation
    Set root password? [Y/n] Y
    Remove anonymous users? [Y/n] Y
    Disallow root login remotely? [Y/n] Y
    Remove test database and access to it? [Y/n] Y
    Reload privilege tables now? [Y/n] Y
  • สร้าง Zabbix MySQL Database:
    bbix]# mysql -uroot -p
    MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
    ariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
    riaDB [(none)]> flush privileges;
    iaDB [(none)]> quit
  • bix]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
  • ix]# yum install vim
    Is this ok [y/d/N]: y
  • x]# echo "syntax on" > ~/.vimrc
  • ]# vim /etc/zabbix/zabbix_server.conf
    :/DB
    Not to delete the default values and not to edit them just copy paste.
    # DBHost=localhost
    DBHost=localhost
    DBPassword=password
    Esc
    : x
  • # service zabbix-server start
    If restart machine Zabbix server won't come up.
  • systemctl enable zabbix-server
  • ทำการแก้ไข Configure เพื่อทำการ Update Timezone ของ Zabbix:
    vim /etc/httpd/conf.d/zabbix.conf
    มองหาข้อความและแก้ไขดังนี้:
    php_value date.timezone Asia/Bangkok
    : x
  • หลังจากทำการแก้ไขเรียบร้อยแล้ว ต้องทำการ Restart Service Apache:
    service httpd restart
  • หลังจากทำการตั้งค่าเสร็จเรียบร้อยแล้ว ให้ทำการ Start Zabbix ตามคำสั่งนี้:
    service zabbix-server status
    Active: active (running)
    See child processes
  • service httpd status
  • service mariadb status
  • ip a
    2: enp0s3:
    inet 10.10.10.11/28
  • หลังจากทำการ Start Zabbix เรียบร้อยแล้วให้ทำการเข้าผ่านหน้า Web:
    http://10.10.10.11/zabbix
    Next step can scroll it's down everything is OK.
    Password: password
    Finish
  • Default Username:
    Username: Admin
    Password: zabbix
    Sign in
  • www.zabbix.com/documentation/4.0/manual/installation/install_from_packages
Zabbix agents: คือ Software เพิ่มเติมที่ติดตั้งหลังจากติดตั้ง Zabbix Server เพื่อใช้ในการ Monitor ตัว Zabbix Server แบ่งเป็นสองกรณี:
  1. Passive Check คือ Zabbix Agent จะส่งข้อมูลหาฝั่ง Server เมื่อมีการร้องขอ
  2. Active Check คือ Zabbix Agent จะส่งข้อมูลหาฝั่ง Server เป็นระยะๆ
  • yum install zabbix-agent
    Is this ok [y/d/N]: y
  • vim /etc/zabbix/zabbix_agentd.conf
    LogFileSize=100(MB)
    EnableRemoteCommans=1
    LogRemoteCommands=1
    #Hostname=Zabbix server
    RefreshActiveChecks=60(seconds)
    : x
  • systemctl enable zabbix-agent
  • systemctl start zabbix-agent
  • service zabbix-agent status
cool.gif
 

PlAwAnSaI

Administrator
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
cool.gif
 

PlAwAnSaI

Administrator
Creating calculated items. Practical usage:
  • Configuration > Hosts > gateway > Create item
    Name: Last value as % of 5 min max
    Type: Calculated
    Key: last.calculated
    Formula: 100*last("wlan1.traffic.in")/max("wlan1.traffic.in","300")
    • 100% x last("wlan1.traffic.in") / max("wlan1.traffic.in","5 mins")
    Units: %
    History storage period: 1d
    Trend storage period: 3d > Add
  • # zabbix_server -R config_cache_reload
  • Last value as % of 5 min max > Check now
  • Monitoring > Latest data
    Hosts: gateway > Apply
    Last value as % of 5 min max Last value: 16 %
  • Tick: Last value as % of 5 min max & wlan1 incoming traffic > Display graph
  • www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/calculated?s[]=calculated&s[]=items
Create and apply templates. Group hosts into host groups. Explain host groups and templates:
  • Configuration > Host groups > Create host group
    Group name: Google > Add
  • Configuration > Hosts > Create host
    Host name: 8.8.8.8
    Groups: Google > Add
    8.8.8.8 > Full clone
    Host name: 8.8.4.4 > Add
    8.8.8.8 > Full clone
    Host name: google.com > Add
  • Configuration > Templates > Create template
    Template name: Google ping
    Groups: Google > Add
  • Google ping Items > Create item
    Name: Ping
    Type: Simple check
    Key: Select > icmpping[,,,,] > [{HOST.HOST},5,20,40,200] > Add
  • Configuration > Hosts
    Group: Google > Tick all > Mass update > Templates > Link templates > Google ping > Update
  • Monitoring > Latest data
    Host groups: Google > Apply
    Last value: 1
  • www.zabbix.com/documentation/4.0/manual/config/templates
Explain macros in Zabbix. Practical usage. Configuring same macros on different levels. Macro priorities. Macro types:
  1. System macro / macro functions:
    {HOST.HOST} ; {HOST.NAME}
  2. User macros:
    {$TIMEOUT} ; {$LIMIT}
  3. Low-level discovery macro:
    {#RULE} ; {#NAME}
  • priority Host level
  • priority Template
  • priority Global
  • priority Global
    Configuration > Templates > Create template Name: Echo script > Items > Create item
    Name: Echo
    Type: External check
    Key: echo.sh["{$NUMBER}"]
    Type of information: Text > Add
  • Administration > General > Drop down list: Macros > Add
    Macro: {$NUMBER}
    Value: 1 > Update
  • Configuration > Hosts > Tick 3 google hosts > Mass update > Templates > Link templates: Echo script > Update
  • # zabbix_server -R config_cache_reload
  • Monitoring > Latest data > Host group: Google > Apply
    Echo Last value: one
  • priority Template
    Configuration > Templates > Echo script > Macros > Inherited and template macros
    Macro {$NUMBER} Effective value: 2 > Update
  • Monitoring > Latest data > Host group: Google > Apply
    Echo Last value: two
  • priority Host level
    Host Name: 8.8.8.8 > Macros > Inherited and template macros
    Macro {$NUMBER} Effective value: 5 > Update
  • Monitoring > Latest data > Host group: Google > Apply
    8.8.8.8 Echo Last value: nodata
  • www.zabbix.com/documentation/4.0/manual/config/macros
Explain usage of regular expressions. Difference between usage of simple and complex ones:
cool.gif
 
Top