Problem to configure sendmail

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
egomes
Posts: 2
Joined: Fri Mar 27, 2015 8:44 am

Problem to configure sendmail

Post by egomes »

Hi.

I install Nagios Core 3.4.1, create hosts and install sendmail for notifications.

The notifications is work, but not correctly. I recieve the email, but isnt correct

My command to send notification:

define command {
command_name notify-host-by-email
command_line /usr/bin/sendEmail -s 199.59.96.218 -f [email protected] -xu [email protected] -xp xxx -t [email protected] -u ** $NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ esta com o status $SERVICESTATE$ ** -m "***** Nagios *****" \n Notification Type: $NOTIFICATIONTYPE$ \n Service: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$ \n \nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n
}

My recevied email

title = ** PROBLEM: Switch-EMB/$SERVICEDESC$ esta com o status $SERVICESTATE$ **

message => ***** Nagios ***** Notification Type: PROBLEM n Service: $SERVICEDESC$nHost: Switch-EMBnAddress: 192.168.1.101nState: $SERVICESTATE$nnDate/Time: Tue Apr 14 16:46:50 BRT 2015nnAdditional Info:nn$SERVICEOUTPUT$n

---------------------------

The "\n" do not work.

Only the date,host and notificationtype in the variables is in the email recieved.

Pleease help.
egomes
Posts: 2
Joined: Fri Mar 27, 2015 8:44 am

Re: Problem to configure sendmail

Post by egomes »

I use \\n and resolve my problem 1.

My problem 2 stills.The variables $SERVICEDESC$ and $SERVICESTATE$ are not in the email

***** Nagios *****
Notification Type: PROBLEM
Service: $SERVICEDESC$
Host: Switch-EMB
Address: 192.168.1.101
State: $SERVICESTATE$

Date/Time: Tue Apr 14 17:12:32 BRT 2015
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem to configure sendmail

Post by jdalrymple »

Note the instructions on this page.

Just like when using sendmail, it is preferable to pipe the contents of the E-mail into the sendemail binary.
Locked