ZABBIX e Linux
ZABBIX e Linux
ZABBIX e Linux
technologyrss.com
Then reboot your machine command reboot with root user or using sudo.
Step #03: When completed install apache server then install mysql database
server.
root@Zabbix-Server:~# apt-get install mysql-server
Step #04: Zabbix update version install many php. Copy all code in one line
then run it.
root@Zabbix-Server:~# apt-get install php php7.0-cli php7.0-common php7.0-mysql php7.0-mysql php7.0-curl php7.0-json
php7.0-cgi php7.0 libapache2-mod-php
Step #05: Download Zabbix update deb file using wget command.
root@Zabbix-Server:~# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-
1+xenial_all.deb
Step #06: Configure Zabbix mysq database and user. Goto mysql terminal
root@Zabbix-Server:~# mysql -u root -p
Step #08: Ensure Zabbix Server conf file inserted below lines such as
root@Zabbix-Server:~# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=passw0rd
Step #09: Edit your Server local time zone where Server located. When your
server Newyork then type America/New_York into php.ini file. (Line number
924)
root@Zabbix-Server:~# vi /etc/php/7.0/apache2/php.ini
Example below.
date.timezone ="America/New_York"
Now apache and Zabbix server start all is ok. Going to your browser and type
your Zabbix Server IP address and press Enter.
If you see does’t start Zabbix Server so now start command below.
Now goto your browser type Zabbix server IP address as like below.
http://Zabbix-Server-IP/zabbix/
Please see web installation process for Zabbix Server
Then complete installation process now login here.
root@technologyrsslocal:~# wget
http://repo.zabbix.com/zabbix/3.5/ubuntu/pool/main/z/zabbix-release/zabbix-
release_3.5-1%2Bbionic_all.deb
Step #06: Zabbix server fronted mysql and php installation command below.
root@technologyrsslocal:~# apt install zabbix-server-mysql zabbix-frontend-php
Step #07: Create Zabbix database and user from mysql terminal.
root@technologyrsslocal:~# mysql -u root -p
mysql > create database zabbix character set utf8 collate utf8_bin;
\q
Step #08: Create mysql table for store all data goto below directory
root@technologyrsslocal:~# cd /usr/share/doc/zabbix-server-mysql/
Step #09: Configure Zabbix Server conf file so open conf file via vim or vi
editor
root@technologyrsslocal:~# vi /etc/zabbix/zabbix_server.conf
Make sure insert into all below config into zabbix_server.conf file.
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=passw0rd
Step #11: Goto your using browser and type Server IP address like as below.
http://Zabbix-Server-IP/zabbix/
Now see your server details like as ubuntu 18.04, mysql and php version.
Get value from client machine into Zabbix server via Zabbix agent. So you
don’t configure Zabbix agent into windows machine then follow this guide :
At first download Zabbix pre-compiled agents from Zabbix official web site.
Step #01: Extract download file then copy all file and drop into C:\ drive any
folder.
Step #02: Open cmd must be run Administrator. Now install Zabbix agent on
windows with cmd.
Step #03: Start Zabbix agent two ways one command line and two windows
services.
Start Zabbix agent with command line.
C:\>zabbix_agents_3.2.0.win\bin\win64\zabbix_agentd.exe --start
Step #04: Start Zabbix agent with windows services. Goto control panel /
Administrative Tools or search services. Find Zabbix agent service on the
bottom side. Like below image.
Server=10.66.110.20
ServerActive=10.66.110.20
Hostname=DESKTOP-58RTMEO
Then save and goto command line for restart Zabbix agent.
C:\>zabbix_agents_3.2.0.win\bin\win64\zabbix_agentd.exe --stop
C:\>zabbix_agents_3.2.0.win\bin\win64\zabbix_agentd.exe --start
Step #04: Now configure zabbix agent file. Open zabbix agent file via vi, vim,
nano or other linux file editor.
root@ubuntuvm:~# vim /etc/zabbix/zabbix_agentd.conf
Before:
#Server=127.0.0.1 [Zabbix server ip]
#Hostname=Zabbix Hostname [Hostname of client]
After:
Server=10.66.10.10
Hostname=ubuntuvm
Step #02: Add zabbix user parameter for mysql server monitoring.
Create userparameter_mysql.conf file into /etc/zabbix/zabbix_agent.d/ location.
Open vim /etc/zabbix/zabbix_agent.d/userparameter_mysql.conf. Then insert
below all lines.
# For all the following commands HOME should be set to the directory that
has .my.cnf file with password information.
# Flexible parameter to grab global variables. On the frontend side, use keys like
mysql.status[Com_insert].
# Type may be "data", "index", "free" or "both". Both is a sum of data and index.
Default is "both".
UserParameter=mysql.version,mysql -V
Step #03: Type mysql -uroot -ppassw0rd for create database, drop database,
create user, create table, drop user, drop table etc.
root@zabbix-server:~# mysql -uroot -ppassw0rd
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Now create user for send data from mysql databases server with password.
Then insert previously created mysql user and password on .my.cnf file.
[mysql]
user=zabbix_user
password=passw0rd
host=localhost
[mysqladmin]
user=zabbix_user
password=passw0rd
host=localhost
Step #05: Now goto your zabbix server and check latest data see all data as
like below image.
Click Monitoring/Latest data then select Hosts “zabix server name” again click
apply.
Thank You Very much. My next tutorial How To Check mysql Status On My
Zabbix Client Machine
Step #01: At first login your Zabbix server using zabbix default user name and
password
Zabbix user name : Admin [must user capital ‘A’]
Default password : zabbix
Zabbix Dashboard as like below image.
Step #02: Goto Administration / Media Types click Email all settings such as
below.
Name : ‘Email’
Type : ‘Email’
SMTP server : ‘smtp.gmail.com’
SMTP server port : ‘25′
SMTP hello : ‘gmail.com’
SMTP email : ‘alaminmonirbd@gmail.com’
Connection security : ‘STARTTLS’
SSL verify peer : ‘N/A’
SSL verify host : ‘N/A’
Authentication : ‘Normal password’
Username : ‘alaminmonirbd’
Password : ‘your_gmail_password’
Enabled : ‘Click check mark’
Then click Update
Step #03: Goto users menu on the Administrator down tab then
click Admin user. Now show three tab such as User, Media and
Permission. Click Media tab then click Edit. Open popup window as like below
image.
Step #04: Select Type, Send to, When active, Use if severity (Not classified,
Information, Warning, Average, High, Disaster etc.) Enabled (Must click check
mark). Then click Update.
Now create trigger for ping test your zabbix client machine.
Click Configuration / Hosts then click Triggers. Now create new trigger for
ping test click on right corner on the hosts. Type any name (ping test),
Severity (High), Expression {YourHostName.agent.ping.nodata(1m)}=1
another settings are all right. Got bottom now click Add button. Successfully
created ping test trigger for zabbix client machine.
Step #05: Now goto Configuration / Actions on Click Report problems Zabbix
administrators. you can see on right status is enabled. Open three
tabs Actions, Operations and Recovery Operations. The you will see as like
image below.
Actions (Actions setting is host trigger settings)
Operations and (Operations settings when host may be problem then
active this option)
Recovery Operations (Recovery Operations settings when may be host
resolved then active this optin)
Configure Action feature below:
Create new condition select Trigger type here to search on the right
side Select then show will popup window select group on the added my client
machine and select Host on the right side client host name.
Now see all trigger on the bottom side. Click Ping Test then click Add then
click Operations tab for send custom message for mail
notification. Operationsfeature is trigger status problem and another
option Recovery operations feature is trigger status ok.
Configure Operations feature below:
Operations Edit option as like below image.
Carefully check Operation details such as
Operation details
1. Operation type Send message
2. Send to User groups Zabbix Administrator or Addanother user
3. Send only to Email
Then click Update not button.
Thank you very much please share my post any social media
Step #01: Login your Zabbix server using Zabbix default user name and
password.
Zabbix user name : Admin (Must ‘A’ is capital letter)
Zabbix password : zabbix (You can change your password anytime)
Step #02: Goto Configuration / Hosts click Create host on the top right corner.
Show as like below image:
Step #03: Three important option such as Host Name, IP
address and Templates
1. Host (Your windows host name, select any group)
2. Agent interface (Agent interface your host IP address)
3. Templates (Select windows template name “Template OS Windows”)
Then click Add two times. Successfully added windows host.
Next you have to needed how to Install Zabbix agent into windows machine.
Also visit Send mail notification from Zabbix server using gmail.
For more details goto YouTube channel and subscribe channel
Step #02: Now install some required packages like as php. mysql and git.
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2
mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear
php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient-dev mpg123
libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool
autoconf git subversion unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev
libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev
libspandsp-dev libmyodbc
During installation, you need to set a password for the MySQL. In my case I
set a password “passw0rd”
Now create asterisk user and asterisk database with all grant privileges.
Peer uninstall DB
Peer Install DB
root@FreePBX:/usr/src# wget -c
https://src.fedoraproject.org/lookaside/pkgs/iksemel/iksemel-1.4.tar.gz/
md5/532e77181694f87ad5eb59435d11c1ca/iksemel-1.4.tar.gz
root@FreePBX:/usr/src/iksemel-1.4# cd ../
root@FreePBX:/usr/src# wget -c
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-
12.8.2.tar.gz
root@FreePBX:/usr/src# git clone https://github.com/akheron/jansson.git
root@FreePBX:/usr/src# git clone https://github.com/asterisk/pjproject.git
Step #06: Goto cd ../ for previous directory then run one by one command
root@FreePBX:/usr/src/pjproject# cd ../jansson
root@FreePBX:/usr/src/jansson/# autoreconf -i
root@FreePBX:/usr/src/jansson/# ./configure
root@FreePBX:/usr/src/jansson/# make
root@FreePBX:/usr/src/jansson/# make install
root@FreePBX:/usr/src/pjproject# cd ../
root@FreePBX:/usr/src# tar xf asterisk-12.8.2.tar.gz
root@FreePBX:/usr/src/jansson/# cd asterisk-12.8.2/
root@FreePBX:/usr/src/asterisk-12.8.2# ./configure
root@FreePBX:/usr/src/asterisk-12.8.2# contrib/scripts/get_mp3_source.sh
root@FreePBX:/usr/src/asterisk-12.8.2# make menuselect
Step #09: Download FreePBX web gui and added some permission
root@FreePBX:/var/lib/asterisk/sounds# cd /mnt
root@FreePBX:/mnt# wget
http://mirror.freepbx.org/modules/packages/freepbx/freepbx-12.0-latest.tgz
root@FreePBX:/mnt# tar xf freepbx-12.0-latest.tgz
root@FreePBX:/mnt# useradd -m asterisk
root@FreePBX:/mnt# chown asterisk. /var/run/asterisk
root@FreePBX:/mnt# chown -R asterisk. /etc/asterisk
root@FreePBX:/mnt# chown -R asterisk. /var/{lib,log,spool}/asterisk
root@FreePBX:/mnt# chown -R asterisk. /usr/lib/asterisk
root@FreePBX:/mnt# chown asterisk /var/lib/php5/
root@FreePBX:/mnt# chown asterisk.asterisk /var/lib/php5/
root@FreePBX:/mnt# rm -rf /var/www/html
Step #10: Increase upload maximum size and add asterisk use and
group. upload_max_filesize=120M and add User asterisk, Group asterisk
root@FreePBX:# vi /etc/apache2/apache2.conf
User asterisk
Group asterisk
See my video for upload file size, add user and group
Step #11: Goto mysql terminal and import FreePBX asterisk and asteriskcdrdb
databases.
When database import then ask mysql database password and type here.
root@FreePBX:/mnt# cd freepbx/SQL/
root@FreePBX:/mnt/freepbx/SQL# mysql -u root -p asterisk < newinstall.sql
root@FreePBX:/mnt/freepbx/SQL# mysql -u root -p asteriskcdrdb <
cdr_mysql_table.sql
root@FreePBX:/mnt/freepbx/SQL# cd ../
root@FreePBX:/mnt/freepbx# ./start_asterisk start
root@FreePBX:/mnt/freepbx$ ./install_amp
root@FreePBX:/mnt/freepbx/SQL# reboot
Now got your browser and type your FreePBX server ip address then create admin
user for login web GUI.
http://10.66.51.10/admin/
Prepare login credential using created user name and password.
Troubleshooting
Client denied by server configuration: /var/www/html/admin/
Step #01: Browse your FreePBX server IP and type login credential created
after installation.
Click Connectivity / Trunks (Drop down position 4) .
Appear on show This page is used to manage various system trunks.
Then click +Add Trunk and choose drop down +Add SIP (chan_sip) Trunk.
Step #02: You can see three tabs such as General, Dialed Number Manipulation
Rules and sip Settings.
General Settings:
These rules can manipulate the dialed number before sending it out this trunk.
If no rule applies, the number is not changed. The original dialed number is
passed down from the route where some manipulation may have already
occurred. If the number matches the combined values in the prefix plus
the match pattern boxes, the rule will be applied and all subsequent rules
ignored.
Upon a match the prefix, if defined, will be stripped. Next the prepend will
inserted in front of the match pattern and the resulting number will be sent to
the trunk. All fields are optional.
Rules:
PEER Details :
Incoming Settings:
USER Context : from-trunk
USER Details :
secret=Connected crediantials [Provided From SIP provider]
type=peer
context=from-trunk
nat=yes
insecure=very
quality=yes
If you can’t see any error massage on your astersik cli then you confirm that,
you asterisk server connected on SIP provider service
Step #03: Add CloudStack RPM package repository for updates when the
installation process ruining.
[root@CloudST-CentOS ~]# vi /etc/yum.repos.d/cloudstack.repo
[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/centos/6/4.9/
enabled=1
gpgcheck=0
Step #04: Configure NFS for manage primary and secondary storage. Install
command below:
[root@CloudST-CentOS ~]# yum -y install nfs-utils
Create two directory for primary and secondary storage. Example command
below:
/mnt/secondary 10.44.0.0/16(rw,async,no_root_squash,no_subtree_check)
/mnt/primary 10.44.0.0/16(rw,async,no_root_squash,no_subtree_check)
#Apache CloudStack
-A INPUT -s 10.44.0.0/16 -p udp -m state --state NEW -m udp --dport 111 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p tcp -m state --state NEW -m tcp --dport 111 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p tcp -m state --state NEW -m tcp --dport 2049 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p tcp -m state --state NEW -m tcp --dport 892 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p udp -m state --state NEW -m udp --dport 892 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p tcp -m state --state NEW -m tcp --dport 875 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p udp -m state --state NEW -m udp --dport 875 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p tcp -m state --state NEW -m tcp --dport 662 -j ACCEPT
-A INPUT -s 10.44.0.0/16 -p udp -m state --state NEW -m udp --dport 662 -j ACCEPT
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
Step #07: Edit mysql repo file for update from source. Open vi
/etc/yum.repos.d/mysql.repo
Insert all below lines into mysql.repo file.
[mysql-connectors-community]
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/
$basearch/
enabled=1
gpgcheck=1
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red
Hat Support.
All are ok then finish installation process from terminal. Next step goto your
browser and type your Cloud srver IP address and default port like as below.
http://Your_Server_IP:8080/client/
CloudStack Management Server default user name and password:
Step #02: CloudStack all host, VM, snapshot, volume, iso image and more
store on the two directory such as /primary and /secondary.
Primary storage store on all running VM on host. At least on primary
storage must be configure per zone basis.
Secondary storage store templates, iso image and disk volume snapshot
etc.
Step #03: Create two directory /mnt/primary and /mnt/secondary for nfs share.
root@cloud-nfs:~# mkdir -p /mnt/primary /mnt/secondary
Step #04: Insert /etc/exports file your created directory. Open /etc/exports file
and insert below line.
/mnt/primary/ 10.55.0.0/16(rw,async,no_root_squash,no_subtree_check)
/mnt/secondary/ 10.55.0.0/16(rw,async,no_root_squash,no_subtree_check)
Step #05: Insert public or local domain name on /etc/idmapd.conf below line.
Open your /etc/idmapd.conf file
NEED_STATD=yes
Step #06: Goto cloud management server for mount /mnt/secondary directory.
Create /mnt/secondary directory on your cloud management server.
root@cloud-mgmt:~# mkdir /mnt/secondary
Step #08: Mount /mnt/secondary directory from nfs share on your cloud
management server.
root@cloud-mgmt:~# mount -t nfs your_nfs_server_ip:/mnt/secondary /mnt/secondary/
If you confuse then goto /mnt/secondary and create “test_directory”. Now goto
nfs server /mnt/secondary and check this created directory.
/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver
Step #10: Prepare the system VM template. Now run below command for
download system VM. Wait for at least 30 minute or less.
root@cloud-mgmt:~# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-
install-sys-tmplt -m /mnt/secondary/ -u
http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-xen.vhd.bz2 -h
xenserver
Step #11: when download completed then umount /mnt/secondary and
remove /mnt/secondary directory from your cloud management server.
root@cloud-mgmt:~# umount /mnt/secondary
root@cloud-mgmt:~# rm -rf /mnt/secondary
127.0.0.1 localhost
Step #03: Configure DEB package repository to your apt sources for ubuntu
14.04 [trusty]. Open source list file via any editor such as vi, vim or nano.
root@cloud-mgmt:~# vim /etc/apt/sources.list.d/cloudstack.list
Step #06: After completed install. Then install mysql server on your
management server.
root@cloud-mgmt:~# apt-get install mysql-server
[mysqld]
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
Insert [mysqld] line and save it. Now restart mysql server.
root@cloud-mgmt:~# service mysql restart
Step #08: Don’t forget disable your firewall. ubuntu firewall name like as ufw.
root@cloud-mgmt:~# ufw disable
Step #09: Configure your cloud databases and add cloud user this command
below. Details as like
cloudstack-setup-databases “cloud_user”:”db_password”@localhost –deploy-
as=root:”root_passw0rd”
Step #10: Now start, stop and restart your management server command
below.
root@cloud-mgmt:~# cloudstack-setup-management
Finally Goto your browser then type server ip and port 8080.
http://10.55.50.10:8080/client/
If you can’t access web GUI then goto step #09 and read again very carefully.
Default login
UserName : admin
Password : password
Now prepare NFS Server for cloudstack management server
Now I would like to show how to install Zabbix agent on your XEN Server
7.0.2
Step #01: At first download rpm package from Zabbix official page.
[root@XEN-SERVER ~]# rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
Step #02: Configure iptables for allow Zabbix port. Open iptables file
[root@XEN-SERVER ~]# vi /etc/sysconfig/iptables
# Zabbix-Agent
-A RH-Firewall-1-INPUT -p tcp –dport 10050 -j ACCEPT
Step #03: Now configure Zabbix agent. So at first enable Zabbix agent.
[root@XEN-SERVER ~]# systemctl enable zabbix-agent
Step #04: Edit Zabbix agent file for monitor XEN Server.
Open zabbix_agentd.conf file and insert Zabbix Server IP and your XEN
Server host name.
[root@XEN-SERVER ~]# vi /etc/zabbix/zabbix_agentd.conf
Server=20.50.10.10
ServerActive=20.50.10.10
Hostname=XEN-SERVER
Details :
Now goto your Zabbix Server fronted then add your XEN Server host.
Remember it! When you add new rule then first save and then start iptables
service. But many people without save and restart iptables service.