Infrastructure/Monitoring

Zabbix custom item

rajent 2020. 12. 4. 20:11
728x90

Web Service: 80,8080, 8088
jenkins, python -django (NginX, uwsgi)

       NginX 설정방법
       - template
         https://github.com/v-zhuravlev/zbx_template_nginx
       - nginx 및 zabbix agent conf설정
         https://www.badllama.com/content/monitor-nginx-zabbix
         => nginx에 http_stub_status_module 설치가 되어있어야 사용가능... 재설치 필요
       Web Monitoring으로 http port access 체크 (완료)
       ssh monitoring으로 jenkins log size check 적용(완료)
       NTP monitoring
        - Template App NTP Service 적용

Active Directory -
https://share.zabbix.com/operating-systems/windows/windows-ad-event-log-2008-r2-2012-r2

DHCP check

  • system.run 명령으로 powershell -command 로 scirpt 호출
    . netsh dhcp server show mibinfo|findstr use |%{$data = $.split("="); Write-Output "$($data[1])"} |%{$str = $.trim("."); Write-Output "$str"}
    . netsh dhcp server show mibinfo|findstr free |%{$data = $.split("="); Write-Output "$($data[1])"}|%{$str = $.trim("."); Write-Output "$str”}
    . netsh dhcp server show mibinfo|findstr pending |%{$data = $.split("="); Write-Output "$($data[1])"}|%{$str = $.trim("."); Write-Output "$str"}

    system.run[powershell.exe -command c:\scripts\DHCP_Free_Count.ps1]
    => item value preprocessing으로 scriptless방식으로 변경

NTP check

  • Window template에 NTP Server item추가
    . system.run[powershell.exe -command "w32tm /query /configuration | findstr NtpServer:"]
    . Preprocessing에 javascript 추가
    var data = value.split(' ');
    var rt = data[1].split(',');
    return rt[0];