The CHECK SYSTEM unique name is expected to be resolvable

Issue #403 resolved
Former user created an issue

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)

  1. Tildeslash 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 }
    
  2. Tildeslash 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.

  3. Cyril B.

    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
    
  4. r1zar.it

    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
    
  5. Log in to comment