Problem with enabling notifications with postfix

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.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Problem with enabling notifications with postfix

Post by Jessuzz94 »

tgriep the notifications are enabled.

my notifications commands? ok, the path that i put in commands.cfg in notify-host-by-email and notify-service-by-email is /usr/bin/mail
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with enabling notifications with postfix

Post by jdalrymple »

jdalrymple wrote:We need to see your notification commands, notify-host-by-email and notify-service-by-email.
Jessuzz94 wrote:ok, the path that i put in commands.cfg in notify-host-by-email and notify-service-by-email is /usr/bin/mail
Please share with us the entire command from commands.cfg. Please help us help you.

Are you sure that the path is /usr/bin/mail?

Code: Select all

/usr/bin/mail -V
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Problem with enabling notifications with postfix

Post by Jessuzz94 »

Is the path where i have mail, for default, were /bin/mail and in this path i have nothing, i wil post the information
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with enabling notifications with postfix

Post by tgriep »

You can run this on your system to see where the mail program is on your system.

Code: Select all

which mail
Can you upload the commands.cfg file to this post so we can see how the commands are defined?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Problem with enabling notifications with postfix

Post by Jessuzz94 »

Yeah is correct, /usr/bin/mail
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with enabling notifications with postfix

Post by jdalrymple »

Here is the deal Jessuzz94 - we've asked you for your notify-host-by-email and notify-service-by-email commands at least 4 times and you have yet to provide them. They are absolutely 100% the next thing we need to see in order to help you. If you cannot provide them we cannot help you. Kindly provide them please or else we'll have to lock the topic.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Problem with enabling notifications with postfix

Post by Jessuzz94 »

Sorry, i cant connected to the server from ssh to copy all the code, it can copy all the text with some editor using only the console witthout mouse?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with enabling notifications with postfix

Post by jdalrymple »

screen capture is fine. We just need to review it.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Problem with enabling notifications with postfix

Post by Jessuzz94 »

Code: Select all

# 'notify-host-by-email' command definition
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAd
dress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE
$ **" $CONTACTEMAIL$  -r jessuzz94@gmail.com
        }

# 'notify-service-by-email' command definition
define command{
        command_name    notify-service-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALI
AS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | usr/bin/mail -s "** $NOTIF
ICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -r jessuzz94@gmail.com
        }
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with enabling notifications with postfix

Post by jdalrymple »

In both commands...

Code: Select all

/usr/bin/mail
not

Code: Select all

usr/bin/mail
Locked