IPTABLES 옵션 정리
하기와 같이 -h 옵션을 주면 설정방법이 자세히 나와있습니다.
양이 좀 많지만 자주 사용하는 옵션으로 iptables 의 설정방법을 알아보겠습니다.
$ iptables -h
iptables v1.4.7
Usage: iptables -[ACD] chain rule-specification [options]
iptables -I chain [rulenum] rule-specification [options]
iptables -R chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
...
Zabbix Disk Monitoring 설정하기
zabbix에서 disk-performence를 모니터링 하는 방법입니다.
참고사이트 : https://github.com/grundic/zabbix-disk-performance
1. diskstats user parameters config
/etc/zabbix/zabbix_agent.d/위치로 이동하여 해당 설정 파일을 다운받습니다.
$ cd /etc/zabbix/zabbix_agentd.d/
$ wget https://raw.githubusercontent.com/grundic/zabbix-disk-performance/master/userparameter_diskstats.conf ...
Zabbix error Too many connections
zabbix 운영 중에 server가 갑자기 멈췄다.(하루동안 아무도 몰랐다는게 함정. ㄷㄷ)
프로세스는 살아있었지만 정상적인 일을 하지못하여 아무런 값을 받아오지 못하고 있었다.
1. LOG 확인
log를 확인해보니, DB connection 오류가 많이 보인다.
process를 죽이고 다시 시작을 해도 다시 stop 되는 상황이 발생했다.
$ cat /var/log/zabbix/zabbix_server.log
...
...
14622:20200820:090347.272 [Z3001] connection to database 'zabbixdb' failed: [1040] Too many conn...
dmidecode로 server에 하드웨어 정보 확인하기
1. dmidecode(Desktop Management Interface) 사용하기
dmidecode 를 사용하면 서버의 모든 하드웨어 정보를 확인할 수 있습니다.
시스템정보가 모두 출력이 되기 때문에 내가 확인하고 싶은 정보만 보고 싶다면
하기 옵션을 사용하시면 됩니다.
$ dmidecode -h
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
-h, --help Display this help text and exit
-...
ShellScript(11) - read a File
데이터 파일을 만든 후 ShellScript에서 사용하는 방법을 알아보겠습니다.
예제.1 - Read a File
$ vi read_file.sh
1
2
3
4
5
#!/bin/bash
file='book.txt'
while read line; do
echo $line
done < $file
$ vi book.txt
1
2
3
4
1. Pro AngularJS
2. Learning JQuery
3. PHP Programming
4. CodeIgniter 3
$ ./read_file.sh
Pro AngularJS
Learning JQuery
PHP Programm...
ShellScript(9) - Arithmetic Operations(산술연산)
산술연산 방법에 대해 알아보겠습니다.
예제.1 - Using ‘expr’ command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Works as string
expr '10 + 30'
# Works as string
expr 10+30
#Perform the addition
expr 10 + 30
#Find out the remainder value
expr 30 % 9
#Using expr with backtick
myVal1=`expr 30 / 10`
echo $myVal1
#Using expr withi...
ShellScript(10) - function(함수)
‘function’(함수) 사용방법에 대해 알아보겠습니다.
예제.1 - Create Function
1
2
3
4
5
6
7
#!/bin/bash
function F1()
{
echo 'I like bash programming'
}
F1
I like bash programming
예제.2 - Create function with Parameters
1
2
3
4
5
6
7
#!/bin/bash
Rectangle_Area() {
area=$(($1 * $2))
echo "Area is : $area"
}
Rectangle_Area 10 20
Area is : 200
예...
213 post articles, 31 pages.