1. 각 서버의 Zabbix agent 설정 변경
open file 개수를 수집하도록 agent 설정 변경 (custom.file.open은 Key 로서, 임의 변경 가능)
1) Linux 예시
echo "UserParameter=custom.file.open,awk '{print \$1}' /proc/sys/fs/file-nr" >> /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent.service
2) Solaris 10 예시 (단, Solaris 10에서 /proc/*/fd 조회하려면 root 권한으로 agent를 실행해야 하므로 위험이 따릅니다.)
echo "UserParameter=custom.file.open,find /proc/*/fd -type f | wc -l" >> /etc/zabbix/conf/zabbix_agentd.conf
echo "UserParameter=custom.file.max,ulimit -Hn" >> /etc/zabbix/conf/zabbix_agentd.conf
/etc/init.d/zabbix stop
/etc/init.d/zabbix start
2. Zabbix 설정 변경
1) Template 이나 특정 서버에 신규 Items 등록 (Key 는 1번에서 등록한 Key값과 동일해야 하고 다른 건 임의 변경 가능)
Name: Number of opened files
Type: Zabbix agent
Key: custom.file.open
Update interval: 10m
Applications: OS
※ Solaris의 경우, Max 값도 수집하도록 별도 등록 (kernel.maxfiles 는 지원되지 않음)
Name: Maximum Number of opened files
Type: Zabbix agent
Key: custom.file.max
Update interval: 1h
Applications: OS
2) 동일하게 Trigger 등록 (Name, Severity, 80등은 변경 가능)
※ 아래는 file-max 80% 이상 사용 시 경고 설정
Name: File Open Usage Exceeds 80%
Severity: 경고
Expression: {Template OS Linux:custom.file.open.last()}/{Template OS Linux:kernel.maxfiles.last()}*100>80
3. 일괄 체크 혹은 이력 삭제 (Not supported 로 수집안될 경우)
ZABBIX_URL/items.php?filter_key=custom.file.open&filter_set=1