본문 바로가기

zabbix

(17)
9. [zabbix agent] nginx http response code and request time 1. zabbix_agentd.conf UserParameter=nginx_code_status[*],/usr/local/etc/scripts/nginx_code.sh "$1" 2. nginx_code.sh #!/bin/sh file="/tmp/zbx_nginx_result" case "$1" in 200) cat $file | awk -F':' '{print $1}' ;; 300) cat $file | awk -F':' '{print $2}' ;; 400) cat $file | awk -F':' '{print $3}' ;; 500) cat $file | awk -F':' '{print $4}' ;; reqtime) cat $file | awk -F':' '{print $5}' ;; esac 3. cro..
8. [zabbix agent] jstat jmx remote 설정 외 jstat을 이용한 수집 1. zabbix_agentd.conf UserParameter=jstat[*],/usr/local/etc/scripts/01.jstat.sh "$1" "$2" 2. 01.jstat.sh #!/bin/sh dir="/usr/local/java/bin" dir2="/usr/local/etc/scripts/java_pid" name="$1" stat="$2" if [ "$stat" = "name" ] ; then pid=`$dir/jps -v | grep "$name" | awk '{print $1}'` echo $pid > $dir2/$name else pid=`cat $dir2/$name` fi case "$stat" in "heap_max") res..
7. [zabbix agent] varnish 1. zabbix_agent2.conf UserParameter=varnishstat[*],/etc/zabbix/scripts/varnishstat.sh "$1" 2. varnishstat.sh #!/bin/sh if [ $1 ] ; then /usr/bin/varnishstat -1 | grep "$1 " | awk '{print $2}' fi 3. zabbix server template
6. [zabbix agent] redis 1. zabbix_agent2.conf : agent에서 지원 됨. ... ### Option: Plugins.Redis.Sessions.*.Password # Password to send to protected Redis server. "*" should be replaced with a session name. # # Mandatory: no # Default: #Plugins.Redis.Sessions.*.Password=abc@micap Plugins.Redis.Sessions.redisserver.Uri=tcp://localhost:6379 Plugins.Redis.Sessions.redisserver.Password={redis password} ... 2. zabbix_agent.conf ..
4. [오류수정] zabbix DB Replication error PRIMARY KEY 중복으로 리플 멈춤 현상 MariaDB [(none)]> show slave status \G; *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: {master ip} Master_User: monitor-backup Master_Port: 3306 Connect_Retry: 60 Master_Log_File: zabbix-bin.000060 Read_Master_Log_Pos: 102938700 Relay_Log_File: mariadb-relay-bin.000119 Relay_Log_Pos: 45037108 ..
3. [이중화] zabbix DB replication 1. [Master] config 수정 [root@ZABBIX levi]# cat /etc/my.cnf [mysqld] ... ## replication server-id = 1 # 유니크 ID log-bin=zabbix-bin # binlog 이름 max_binlog_size = 100M # 1개의 binlog당 최대 사이즈 expire_logs_days = 7 # bin log 보관 주기 7일 binlog_do_db = zabbix # binlog를 쌓을 db명 ... 2. [Master] MariaDB 재기동 3. [Master] replication user 생성 MariaDB [mysql]> grant replication slave on *.* to 'monitor-backup'@'{backu..
1. zabbix server 설치 ## zabbix repository 추가 [root@ZABBIX]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm ## zabbix server, agent 설치 [root@ZABBIX]# yum clean all [root@ZABBIX]# yum install zabbix-server-mysql zabbix-agent2 [root@ZABBIX]# yum install centos-release-scl ## zabbix web front 설치 [root@ZABBIX]# cat /etc/yum.repos.d/zabbix.repo ... [zabbix-frontend] name=Zabb..