본문 바로가기

Monitoring Tools

(81)
11. [zabbix agent] kafka 1. kafka jmx -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9999 2. zabbix server template
10. [zabbix agent] bind 1. zabbix_agentd.conf UserParameter=bind.discoverzones,/usr/local/etc/scripts/bind-stats.py discoverzones UserParameter=bind.json,/usr/local/etc/scripts/bind-stats.py json UserParameter=bind.jsonzone[*],/usr/local/etc/scripts/bind-stats.py jsonzone -z $1 UserParameter=bind.counter[*],/usr/local/etc/scripts/bind-stats.py counter -c $1 UserParameter=bind.zonecounter[*],/usr/local/etc/scripts/bind-..
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 ..
tomcat jvm heap 모니터링 1. 목적 : 운영서버 "OutOfMemory" 의 잦은 발생으로 사용중인 heap 메모리를 영역 별, 세대 별 등으로 자세한 모니터링이 필요하며 모니터링을 통한 영역, 세대별의 할당 메모리 size를 튜닝 할수 있음. 2. JVM heap 구조 - GC(Garbage Collection) 순서 : Eden(객체 최초 생성) → Survivor(From→To) → Old 3. Heap layout 할당에 영향을 주는 스위치들 4. New(Young) Generation 메모리 할당 공식 (참조용으로 실질 할당은 모니터링을 통한다) Eden = NewSize - ((NewSize/(SurvivorRatio + 2)) * 2) From space = (NewSize - Eden)/2 To space = (N..
haproxy 모니터링(haproxy stats) 1. haproxy configure ## stats socket /var/run/haproxy.sock
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..