우분투에서 zabbix postfix Gmail 알림

우분투에서 zabbix postfix Gmail 알림

postfix(gmail로 릴레이)를 사용하여 zabbix Gmail 알림을 완벽하게 구성하는 방법 실제로 이 설정은 내 로컬 컴퓨터에서 작동하지만 실제 서버에서 구현하려고 하면 이메일 알림이 실패하고 관리>감사에서 다음 오류가 표시될 수 있습니다. >행동

Cannot connect to SMTP server [localhost] [gethost() failed for address 'localhost' [Success]]

내 "/var/log/mail.log" 메시지

Aug 26 00:14:31 station1 postfix/smtpd[9385]: connect from localhost.localdomain[127.0.0.1]
Aug 26 00:14:31 station1 postfix/smtpd[9385]: disconnect from localhost.localdomain[127.0.0.1]
Aug 26 00:15:31 station1 postfix/smtpd[9385]: connect from localhost.localdomain[127.0.0.1]
Aug 26 00:15:31 station1 postfix/smtpd[9385]: disconnect from localhost.localdomain[127.0.0.1]

다음과 같이 telnet 명령을 사용하여 postfix Gmail 릴레이 구성을 확인하고 smtp 포트 25에 연결했습니다.

telnet localhost 25

그리고 다음과 같은 터미널에서 메일을 보낼 수도 있습니다.

mail -s "Test mail" [email protected]

다음은 내 미디어 설정이며 이는 내 로컬 컴퓨터에서 작동하는 것과 동일한 설정입니다.

이메일을 입력하세요

SMTP server: localhost
SMTP helo: localhost
SMTP email: zabbix@localhost

내 설정은 다음과 같습니다.

/etc/호스트:

127.0.0.1 localhost.localdomain localhost
<my-ip-here> station1.lab.mycompany.com station1

/etc/zabbix/zabbix_agentd.conf:

# Default:
# Server=

Server=127.0.0.1

### Option: Hostname
# Unique, case sensitive hostname.
# Required for active checks and must match hostname as configured on the server.
#
# Default:
# Hostname=system.uname

Hostname=Zabbix server

### Option: ListenPort
# Agent will listen on this port for connections from the server.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10050

/etc/zabbix/zabbix_agent.conf:

# This is a config file for zabbix_agent
# To get more information about Zabbix visit http://www.zabbix.com

### Option: Server
# IP address of Zabbix server
# Connections from other hosts will be denied
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: yes
# Default:
# Server=

Server=127.0.0.1

### Option: Timeout
# Spend no more than Timeout seconds on processing
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3

호스트 이름:

root@station1:~#hostname
station1.lab.mycompany.com 

내 실제 서버와 로컬 컴퓨터의 유일한 차이점은 호스트 이름입니다.

미디어 설정을 서버 도메인 이름과 호스트 이름으로 변경하려고 시도했지만 소용이 없었습니다.

도움이 필요하세요!.

답변1

zabbix 미디어 유형 구성에서 전자 메일 서버를 localhost가 아닌 127.0.0.1로 구성해 보십시오. localhost가 ::1로 확인되고 zabbix_server가 ipv6 지원 없이 컴파일되면 실패할 수 있습니다.

답변2

https://gist.github.com/superdaigo/3754055 스크립트에서 로그인 비밀번호를 변경하고 을 붙인 다음 /usr/lib/zabbix/alertscripts+ 사용자에게 알림 방법으로 스크립트의 전체 이름(확장자)을 추가하세요.

관련 정보