發表文章

目前顯示的是有「zabbix」標籤的文章

[Zabbix] 基礎主機監控設定 - 客製化腳本發信

圖片
使用 客製化腳本 發信  apt-get install ssmtp mailutils # 備份 cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.default vi /etc/ssmtp/ssmtp.conf ######################################### # # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=neilwang@intentarget.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.gmail.com:587 # Where will the mail seem to come from? #rewriteDomain= # The full hostname hostname=zabbix # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address #FromLineOverride=YES AuthUser=發郵件的帳號 AuthPass=發郵件的密碼 #Gmail可開啟兩階段驗證, 使用應用程式密碼 UseSTARTTLS=YES UseTLS=YES # 輸出除錯資訊 Debug=YES ######################################### vi /usr/lib/zabbix/alertscripts/sendgmail.sh ##############...

[Zabbix] Zabbix 基礎安裝

圖片
首先先看官網:  https://www.zabbix.com/download 官網可以根據你的作業系統與zabbix版本, 給出對應的指令 我選擇的是 zabbix 3.4版 作業系統為 Ubuntu 16.04 使用MySQL, 換成MariaDB也可 安裝zabbix wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb dpkg -i zabbix-release_3.4-1+xenial_all.deb apt update apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent # 登入MySQL/MariaDB mysql -uroot -p password # 建立預設的 zabbix 資料庫 mysql> create database zabbix character set utf8 collate utf8_bin; # 建立 zabbix 用戶, 密碼設成 password (可把password換成自己想要的) mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; mysql> quit; # 使用zabbix用戶將預設的table匯入zabbix資料庫內 zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix 安裝MySQL 可以參考: digital ocean sudo apt-get update sudo apt-get install mysql-server mysql_secure_installation # 觀看 mysql 是否真的有在 running systemctl status mysql.service 安裝PHP 可以參考我這篇: 安裝PHP add-...