- changed status to duplicate
The CHECK SYSTEM unique name is expected to be resolvable
According to the documentation, the CHECK SYSTEM unique name may be anything: "The unique name is usually the local host name, but any descriptive name can be used."
However if it's not resolvable, monit will log errors when alerting: Jun 20 10:12:35 sandbox2 monit[5736]: Cannot translate 'foobar' to FQDN name -- Name or service not known
That error is raised from alert.c, _getFQDNhostname.
I suppose that either the documentation should be updated to reflect that the unique name MUST be resolvable, or the log error should be removed.
Comments (12)
-
repo owner -
Sorry but it's not fixed by that commit, which is included in Monit 5.18 anyway (which I used).
-
repo owner I'm sorry, yes, this warning will still be logged during alert. In practice it is very often error, as that name becomes part of alert sender address (by default "monit@$HOST") - if the domain doesn't resolve, many MTAs will refuse to deliver such email.
To set the correct sender address and get rid of the message, please set the mail-format:
set mail-format { from: monit@mydomain.com }
-
Actually I already do use a custom mail-format, and the error is still printed.
-
repo owner what's the value of "from:" in your mail format? Please also make sure monit was reloaded when configuration changed (you can check the current runtime settings via monit HTTP GUI.
-
Yes, monit was restarted. Relevant config:
#! set mail-format { from: admin@xxx.com subject: [monit] (sandbox2.paris1) $SERVICE $EVENT message: $DATE on sandbox2.paris1 $ACTION $SERVICE: $DESCRIPTION. } check system sandbox2foo.paris1
-
repo owner found the problem, will fix
-
repo owner - changed status to open
-
repo owner - changed status to resolved
Fixed: Issue
#403: If the sender address for monit alert was overriden by "set mail-format" statement, don't try to resolve the hostname to FQDN.→ <<cset 7508ddfa13be>>
-
repo owner - changed version to 5.18.0
-
The same issue on current version 5.25.1 linux-x64
The conf is
set mail-format { from: mymailer@mydomain.com } check system mynotresolvingname if cpu usage (user) > 95% for 5 cycles then alert if loadavg (15min) > 15 then alert if memory usage > 90% for 5 cycles then alert group server-resources
-
repo owner @vblazhnov please can you provide more details (error output)?
- Log in to comment
Fixed already as part of
#356.