Unable to receive any emails from the vCenter
search cancel

Unable to receive any emails from the vCenter

book

Article ID: 369819

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

No recent changes in the environment and email alerts from the vCenter stopped all of a sudden

/var/log/vmware/messages

[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[73281]: 45C7HoRN073281: 45C7HoRO073281: DSN: [email protected];[email protected]... Invalid route address
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[73281]: 45C7HoRO073281: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32145, relay=[127.0.0.1] [127.0.0.1], dsn=4.4.1, stat=Deferred: Connection refused by [127.0.0.1]
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[73892]: 45C7HrFM073892: [email protected], size=1121, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[73892]: 45C7HrFM073892: 45C7HrFN073892: DSN: [email protected];[email protected]... Invalid route address
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[73892]: 45C7HrFN073892: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32145, relay=[127.0.0.1] [127.0.0.1], dsn=4.4.1, stat=Deferred: Connection refused by [127.0.0.1]
[YYYY-MM-DDTHH:MM:SS] vCenter CROND[74846]: (root) CMD ( test -x /usr/sbin/vpxd_periodic && /usr/sbin/vpxd_periodic >/dev/null 2>&1)
[YYYY-MM-DDTHH:MM:SS] vCenter CROND[74845]: (root) CMD (. /etc/profile.d/VMware-visl-integration.sh; /usr/lib/applmgmt/backup_restore/scripts/SchedulerCron.py >>/var/log/vmware/applmgmt/backupSchedulerCron.log 2>&1)
[YYYY-MM-DDTHH:MM:SS] vCenter CROND[74847]: (root) CMD ( /usr/lib/applmgmt/syslog/scripts/syslog_cron.sh >/dev/null 2>&1)
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[79704]: 45C7IdfP079704: [email protected], size=1121, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
[YYYY-MM-DDTHH:MM:SS] vCenter sendmail[79704]: 45C7IdfP079704: 45C7IdfQ079704: DSN: [email protected];[email protected]... Invalid route address

Environment

VMware vCenter server 7.x

VMware vCenter server 8.x

Cause

sendmail service was masked and dead, due to which we don't get any email notifications

Resolution


1. Navigate to /var/log/vmware 

   service sendmail status

   If the service is masked, you will receive the message

   sendmail.service
      Loaded: masked (Reason: Unit sendmail.service is masked.)
      Active: inactive (dead)

2. Unmask the sendmail service
    root@XYZ [ /var/log/vmware ]# systemctl unmask sendmail.service
      Removed /etc/systemd/system/sendmail.service.
      Removed /etc/systemd/system/multi-user.target.wants/sendmail.service.

3. Once we unmask the service we get to know the actual status of the sendmail service (active/disabled). So, check the status again

     root@vCenter [ /var/log/vmware ]# service sendmail status
       ● sendmail.service - Sendmail Mail Transport Agent
          Loaded: loaded (/lib/systemd/system/sendmail.service; disabled; vendor preset: enabled)
         Active: inactive (dead)

4.  sendmail service location # /lib/systemd/system ]# cat sendmail.service

5.  If the service is disabled, /lib/systemd/system/sendmail.service; disabled; we can proceed to restart the service

        service sendmail restart

6.  Check the status after restarting the sendmail service

      root@vCenter [ /lib/systemd/system ]# service sendmail status
        ● sendmail.service - Sendmail Mail Transport Agent
           Loaded: loaded 
           Active: active (running) since [YYYY-MM-DDTHH:MM:SS]; 4s ago
           Process: 71415 ExecStart=/usr/sbin/sendmail -bd -q $QUEUE $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
           Main PID: 71417 (sendmail)
           Tasks: 1 (limit: 19660)
           Memory: 1.8M
           CGroup: /system.slice/sendmail.service
                └─71417 sendmail: accepting connections

                    MM DD 01:47:34 vCenter.XYZ.com systemd[1]: Starting Sendmail Mail Transport Agent...
                    MM DD 01:47:34 vCenter.XYZ.com sendmail[71417]: starting daemon (8.17.1): SMTP+queueing@01:00:00
                    MM DD 01:47:34 vCenter.XYZ.com systemd[1]: Started Sendmail Mail Transport Agent.
                    MM DD 01:47:34 vCenter.XYZ.com sendmail[71417]: STARTTLS=server: file /etc/vmware/vmware-vmafd/machine-ssl.crt unsafe: Permission denied

7.  Create a new alarm definition in the vCenter server and verify if you are getting an email alert.