plugin_monitor icon indicating copy to clipboard operation
plugin_monitor copied to clipboard

Monitor plugin - email notification issue

Open MSS970 opened this issue 1 year ago • 10 comments

Describe the bug Introduction: Monitor plugin sends emails to email lists. if the email list contains multiple email addresses separated by comma, the following bug occurs.

Monitor plugin sends emails to email list (which contains multiple email addresses separated by comma) based on the following cases/events:

  1. Device Reboot Notification Individual emails are generated and sent to each email address separately, the email would look like it has been sent to one email only. This is undesirable behavior because it does NOT: a) Provide the information to the recipients about who receives the email as well. b) Allow automatic assignment of the ITSM incidents when the email is sent to the email list that contains ITSM email address and the support engineer email address, as the email is received by the ITSM without the email address of the support engineer, it is not possible to automatically assign the incident to concerned engineer.

  2. Device Error: device is down One email is generated and sent to all email addresses included in the email list, the email would look like it has been sent to one email only. This is desirable behavior because it will: a) Provide the information to the recipients about who receives the email as well. b) Provide more control when the email is sent to the email list that contains ITSM email address and the support engineer based on which the ITSM automatically categorizes and assigns the incident to required support engineer. c) Unified behavior when sending the email notification

  3. Device Notice: device returned from DOWN state Same behavior and objectives of the above case (point 2)

Expected behavior One email is generated and sent to all email addresses included in the email list, the email would look like it has been sent to one email only. This is desirable behavior because it will: a) Provide the information to the recipients about who receives the email as well. b) Provide more control when the email is sent to the email list that contains ITSM email address and the support engineer based on which the ITSM automatically categorizes and assigns the incident to required support engineer. c) Unified behavior when sending the email notification

Screenshots Attached

Plugin:

  • Version: 2.7
  • Source: github cacti

Device-Reboot-Notification-Undesired-Behavior Device-Error-Notification-Desired-Behavior Device-Notice-Notification-Desired-Behavior

MSS970 avatar Jun 01 '24 09:06 MSS970

Hello, In addition to the above, I'd like to add the following:

For the 1st case "Device Reboot Notification", the email subject does not contain the name of the device (which is undesired behavior) as opposed to the 2nd and 3rd cases, the device name is shown (which is desired behavior).

Appreciate your continuous support. Regards,

MSS970 avatar Jun 02 '24 13:06 MSS970

Dear Support Team, Can you please look into the above reported issues. Regards, MSS

MSS970 avatar Jun 05 '24 13:06 MSS970

Everyone is pretty busy. Have you attempted a fix yourself? We are glad to accept pull requests.

TheWitness avatar Jun 06 '24 03:06 TheWitness

Dear Adam, Please could support by identifying which .php file and file location and I will attempt to resolve it and update you. Much apprecaited. Regards, MSS

MSS970 avatar Jun 06 '24 04:06 MSS970

I mean which .php file is responsible to collect the notification list and which .php is responsible to construct and send the email so that I will review and update.

MSS970 avatar Jun 06 '24 04:06 MSS970

First, in setup.php you will find a settings array. Look at the image below. You should borrow this setting from tholds includes/settings.php and put it in monitor can call is "Send All Notifications as Single Email"

image

Then, grep for "mailer" in the monitor director:

grep -r mailer *

That will tell you where the Emailing is going on.

image

Checkbox values will have either '' or 'on'. If read_config_option('blah') == 'on' that means the setting is checked.

TheWitness avatar Jun 07 '24 03:06 TheWitness

Dear Adam, I have completed modification of 2 files (setup.php and poller_monitor.php). The modification adds the option to send notification emails separately or one email to notification lists.

Regards, MSS

MSS970 avatar Jun 13 '24 09:06 MSS970

I have modified these files online using github.dev as well as the though a new pull request.

Let me know if these are good to be published.

You may close this incident.

Appreciate your help and support.

MSS970 avatar Jun 13 '24 10:06 MSS970

If if you could create a pull request will be able to review it. Appreciate your work thank you.

TheWitness avatar Jun 14 '24 10:06 TheWitness

I created a pull request and submitted the changes in it.

https://github.com/mohabuhtig/plugin_monitor

Appreciate if you can review it.

MSS970 avatar Jun 15 '24 13:06 MSS970

Was the pull request merged?

TheWitness avatar Oct 30 '24 20:10 TheWitness

@MSS970, been on holiday. Bouncing around plugins today. Just doing some housekeeping.

TheWitness avatar Oct 30 '24 20:10 TheWitness

@TheWitness welcome back! hope you enjoyed it :)

The ticket was done and dusted, please proceed with the closure.

MSS970 avatar Oct 31 '24 03:10 MSS970