Voxer / nagios-html-email

Generate HTML emails for Nagios service and host alerts
http://engineering.voxer.com/2014/02/24/nagios-html-email-templates/
22 stars 6 forks source link

Content type: text/plain instead of text/html #2

Open barthex opened 7 years ago

barthex commented 7 years ago

Scripts sent email with Content type set to text/plain, instead of text/html. Test procedure produces valid content type. Operating system Centos 6.9, Nagios 4.1.1

brent20 commented 7 years ago

Same issue here. Email is being sent as raw HTML. Not being rendered by client.

anandsuresh commented 7 years ago

Can you please elaborate how you are using the script? There is no place in the scripts where we use text/plain. The content-type is currently hard-coded to use text/html for all emails.

brent20 commented 7 years ago

I installed the script per the directions and the email that I received was HTML markup, but my email did not render it in HTML. I did see that the flag was set in the JS script, but the email itself I received was still in Plain Text.

kickfliph commented 7 years ago

Hi, I'm doing exactly what the man for the installation says, but the server keeps sending me this: mailx: invalid option -- 't' Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 02: usage: mailx [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-r from-addr] [-s subject] [--] to-addr ... Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 03: mailx [-dEIiNnv] -f [name] Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 04: mailx [-dEIiNnv] [-u user] Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 05: env NAGIOS_CONTACTEMAIL or -a <address> must be supplied! Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 06: Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 07: Usage: nagios-html-email [options] <service|host> [arg1] [arg2] ... Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 08: Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 09: This command is meant to be run from nagios when a service or host Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 10: experiences problems. The output will be suitable for passing to Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 11: a mail program that takes raw email data like mailx -t Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 12: Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 13: Options Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 14: -a, --address the email address to send mail to, defaults to env NAGIOS_CONTACTEMAIL Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 15: -h, --help print this message and exit Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 16: -s, --subject the email subject to use, defaults to _subject for the host/service, or default nagios subject Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 17: -t, --template-dir

dir to find ejs template files, defaults to builtin templates Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 18: -u, --updates check for available updates on npm Jul 12 17:17:02 ip-172-16-4-6 nagios: wproc: stderr line 19: -v, --version print the version number and exit

the smtp of the server working fine, but at the time I try to use the nagios I receive this logs.

In my command.cfg I have:

define command { command_name notify-service-by-email command_line nagios-html-email service http://bla bla bla/nagios | mailx -t }

define command { command_name notify-host-by-email command_line nagios-html-email host http://bla bla bla/nagios | mailx -t }

What I'm mising?,

Thanks for all your help.