Skip to content

Duplicate Hostname in Email subject and body in Check/Task Failed messages #1936

@nescafe2002

Description

@nescafe2002

Server Info (please complete the following information):

  • RMM Version (as shown in top left of web UI): 0.19.2

Installation Method:

  • Docker

Agent Info (please complete the following information):

  • Agent version (as shown in the 'Summary' tab of the agent from web UI): 2.7.0

Describe the bug
Email subject and body contain hostname twice:
Client, Site, Hostname - Hostname - [Policy Name ] - [Check Name] Failed (- [More info])

Additional context
Note that the hostname is included in the (failed) templates and the __str__ methods.

For Checks:

subject = f"{self.agent.client.name}, {self.agent.site.name}, {self.agent.hostname} - {self} Failed"

return f"{self.agent.hostname} - {self.readable_desc}"

For Tasks:

subject = f"{self.agent.client.name}, {self.agent.site.name}, {self.agent.hostname} - {self} Failed"

subject = f"{self.agent.client.name}, {self.agent.site.name}, {self.agent.hostname} - {self} Failed"

return f"{self.agent.hostname} - {self.task}"

Possible solutions:

  • Remove hostname from __str__ functions and add hostname to send_resolved_email functions
  • Revert commits 6b9d775 and 4cae9cd

Also, note that the subject (Client, Site) is not included in the body of the Check resolved message:

body = f"{self} is now back to normal"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions