1. 시스템 정보
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] uname -a
FreeBSD zabbix52.test.co.kr 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f:
Fri Apr 9 04:24:09 UTC 2021 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] pkg inf | grep zab
zabbix52-agent-5.2.6 Enterprise-class open source distributed monitoring (agent)
zabbix52-frontend-5.2.6 Enterprise-class open source distributed monitoring (frontend)
zabbix52-server-5.2.6 Enterprise-class open source distributed monitoring (server)
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] cat /var/run/dmesg.boot | egrep "CPU|memory"
CPU: Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz (2200.00-MHz K8-class CPU)
real memory = 12884901888 (12288 MB)
avail memory = 12451639296 (11874 MB)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
cpu0: <ACPI CPU> numa-domain 0 on acpi0
VMware memory control driver initialized
2. 스크립트 및 설정
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] cat send_sms_zabbix.sh
#!/bin/sh
to=$1
subject=$2
body=$3
/usr/local/etc/zabbix52/zabbix/alertscripts/send_sms.php $to $subject $body
date=`date "+%Y-%m-%d %H:%M:%S"`
logfile="/usr/local/etc/zabbix52/zabbix/alertscripts/log/"`date "+%Y-%m-%d"`
echo "$date $to $subject $body " >> $logfile
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] mkdir ./log
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] chow -R zabbix:zabbix ./log
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] cat send_sms.php
#!/usr/local/bin/php
<?php
$number = $argv[1];
$subject = $argv[2];
$body = $subject." ".$argv[3];
$body = $body." ".$argv[4];
$body = $body." ".$argv[5];
$body = $body." ".$argv[6];
$body = $body." ".$argv[7];
$body = $body." ".$argv[8];
$body = $body." ".$argv[9];
if ( sms_send($number, $body, "zabbix") ) {
echo "SMS Send OK!!!";
} else {
echo "SMS Send Fail--------";
}
?>
3. 웹인터페이스 설정
1) 미디어타입에 해당 스크립트 추가
2) 유저에 추가한 미디어타입과 연락처 추가
3) 액션에 오퍼레이션 추가
관리 - 미디어타입 추가(혹은 갱신)
관리 - 미디어타입 - Message template 추가
관리 - 유저 - 연락방법 추가
설정 - 액션에 추가 혹은 변경
관리 - 미디어타입 - 발송 테스트
4. 더 많은 정보
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 33G 21G 8.8G 71% /
devfs 1.0K 1.0K 0B 100% /dev
ZABBIX 68G 172K 68G 0% /ZABBIX
ZABBIX/data 96G 28G 68G 29% /ZABBIX/data
ZABBIX/logs 68G 96K 68G 0% /ZABBIX/logs
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] zpool status
pool: ZABBIX
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
ZABBIX ONLINE 0 0 0
da1 ONLINE 0 0 0
errors: No known data errors
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] zfs get all | grep comp
ZABBIX compressratio 1.81x -
ZABBIX compression lz4 local
ZABBIX refcompressratio 1.00x -
ZABBIX/data compressratio 1.81x -
ZABBIX/data compression lz4 inherited from ZABBIX
ZABBIX/data refcompressratio 1.81x -
ZABBIX/logs compressratio 1.00x -
ZABBIX/logs compression lz4 inherited from ZABBIX
ZABBIX/logs refcompressratio 1.00x -
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] cat ../../zabbix_server.conf | egrep -v "^#|^$"
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=superultrapower
StartPollers=15
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1,192.168.1.0/24,192.168.2.0/25,10.0.0.0/24
[zabbix52 /usr/local/etc/zabbix52/zabbix/alertscripts # ] cat ../../zabbix_agentd.conf | egrep -v "^#|^$"
LogFile=/tmp/zabbix_agentd.log
Server=127.0.0.1, 192.168.1.100
ServerActive=192.168.1.100
Hostname=Zabbix serve
[zabbix52 /ZABBIX/cfg # ] cat my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
default-character-set=utf8
[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
user = mysql
port = 3306
socket = /tmp/mysql.sock
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /ZABBIX/data
tmpdir = /ZABBIX/mysql_tmpdir
slave-load-tmpdir = /ZABBIX/mysql_tmpdir
secure-file-priv = /ZABBIX/mysql_secure
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
relay-log-recovery = 1
slow-query-log = 1
server-id = 1
sync_binlog = 1
sync_relay_log = 1
binlog_cache_size = 16M
expire_logs_days = 30
default_password_lifetime = 0
enforce-gtid-consistency = 1
gtid-mode = ON
safe-user-create = 1
lower_case_table_names = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options = BACKUP,FORCE
open_files_limit = 32768
table_open_cache = 16384
table_definition_cache = 8192
net_retry_count = 16384
key_buffer_size = 256M
max_allowed_packet = 64M
query_cache_type = 0
query_cache_size = 0
long_query_time = 0.5
innodb_buffer_pool_size = 5G
innodb_data_home_dir = /ZABBIX/data
innodb_log_group_home_dir = /ZABBIX/data
innodb_data_file_path = ibdata1:128M:autoextend
innodb_temp_data_file_path = ibtmp1:128M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_autoinc_lock_mode = 2
skip-symbolic-links
[mysqldump]
max_allowed_packet = 256M
quote_names
quick
[zabbix52 /ZABBIX/cfg # ] free
SYSTEM MEMORY INFORMATION:
mem_wire: 1768407040 ( 1686MB) [ 14%] Wired: disabled for paging out
mem_active: + 1431400448 ( 1365MB) [ 11%] Active: recently referenced
mem_inactive:+ 5086879744 ( 4851MB) [ 40%] Inactive: recently not referenced
mem_cache: + 0 ( 0MB) [ 0%] Cached: almost avail. for allocation
mem_free: + 377876480 ( 360MB) [ 3%] Free: fully available for allocation
mem_gap_vm: + 3828150272 ( 3650MB) [ 30%] Memory gap: UNKNOWN
______________ ____________ ___________ ______
mem_all: = 12492713984 ( 11913MB) [100%] Total real memory managed
mem_gap_sys: + 357036032 ( 340MB) Memory gap: Kernel?!
______________ ____________ ___________
mem_phys: = 12849750016 ( 12254MB) Total real memory available
mem_gap_hw: + 35151872 ( 33MB) Memory gap: Segment Mappings?!
______________ ____________ ___________
mem_hw: = 12884901888 ( 12288MB) Total real memory installed
SYSTEM MEMORY SUMMARY:
mem_used: 7420145664 ( 7076MB) [ 57%] Logically used memory
mem_avail: + 5464756224 ( 5211MB) [ 42%] Logically available memory
______________ ____________ __________ _______
mem_total: = 12884901888 ( 12288MB) [100%] Logically total memory
[zabbix52 /ZABBIX/cfg # ] pkg inf | grep sql
mysql57-client-5.7.34 Multithreaded SQL database (client)
mysql57-server-5.7.34 Multithreaded SQL database (server)
php74-mysqli-7.4.20 The mysqli shared extension for php
php74-pdo_mysql-7.4.20 The pdo_mysql shared extension for php
php74-pdo_pgsql-7.4.20 The pdo_pgsql shared extension for php
php74-pdo_sqlite-7.4.20 The pdo_sqlite shared extension for php
php74-pgsql-7.4.20 The pgsql shared extension for php
php74-sqlite3-7.4.20 The sqlite3 shared extension for php
postgresql12-client-12.7 PostgreSQL database (client)
sqlite3-3.35.5_1,1 SQL database engine in a C library
[zabbix52 /ZABBIX/cfg # ] uptime
11:15오전 up 218 days, 2:55, 1 user, load averages: 0.87, 0.66, 0.65
[zabbix52 /ZABBIX/cfg # ] cat /etc/rc.conf
hostname="zabbix52.test.co.kr"
ifconfig_vmx0="inet 192.168.0.100 netmask 255.255.255.0"
ifconfig_vmx1="inet 192.168.1.100 netmask 255.255.255.0"
ifconfig_vmx2="inet 192.168.2.100 netmask 255.255.255.0"
ifconfig_vmx3="inet 10.0.0.100 netmask 255.255.255.128"
defaultrouter="192.168.0.18"
sshd_enable="YES"
ntpd_enable="YES"
inetd_enable="YES"
zfs_enable="YES"
dumpdev="AUTO"
snmpd_enable="YES"
snmpd_flags="-a"
snmpd_conffile="/usr/local/etc/snmp/snmpd.conf"
zabbix_agentd_enable="YES"
vmware_guestd_enable="YES"
rsyncd_enable="YES"
mysql_enable="YES"
mysql_dbdir="/ZABBIX/data"
mysql_optfile="/ZABBIX/cfg/my.cnf"
[zabbix52 /usr/local/etc/apache24 # ] tail -n 15 httpd.conf
Include etc/apache24/Includes/*.conf
<VirtualHost 192.168.0.100:80>
ServerAdmin admin@test.co.kr
DocumentRoot /usr/local/www/zabbix52/
ServerName zabbix.test.co.kr
ErrorLog /var/log/error_zabbix.log
CustomLog /var/log/access_zabbix.log combined
<Directory "/usr/local/www/zabbix52/">
#ExpiresByType image/swf "access plus 1 years"
</Directory>
</VirtualHost>
반응형
'FreeBSD' 카테고리의 다른 글
freebsd 파티션추가(기존디스크) (0) | 2018.11.27 |
---|---|
[Zabbix] 장애발생시 SMS 통보 (0) | 2017.03.13 |
[FreeBSD]swap 흔적 지우기, swap on/off (0) | 2017.03.09 |
[V2P] vsphere 가상서버 -> 물리서버로 이전하는 방법(Vmware Workstation 이용) (0) | 2017.03.09 |
[freebsd] swap공간을 파일로 추가하기 (0) | 2017.03.09 |
댓글