Open barthex opened 7 years ago
Same issue here. Email is being sent as raw HTML. Not being rendered by client.
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.
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.
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 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.
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