Adding contacts and contact groups
-
- Posts: 15
- Joined: Wed Sep 25, 2019 4:05 pm
Re: Adding contacts and contact groups
But if I run a simple echo hello | mailx email@something.com in the terminal, it does send the email. That must mean postfix is running.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Adding contacts and contact groups
ok, notice you said mailx that is not part of the command you are having nagios use...
Run (from inside the container)
then replace /usr/bin/mail in your commands
restart nagios
But also, are you running that from inside the container?
This is a bit out of our scope as we don't manage containers here....
Run (from inside the container)
Code: Select all
which mailx
restart nagios
But also, are you running that from inside the container?
This is a bit out of our scope as we don't manage containers here....
-
- Posts: 15
- Joined: Wed Sep 25, 2019 4:05 pm
Re: Adding contacts and contact groups
Yes, the terminal runs in the container itself.
Yeah I understand that and that is part of the reason why it is so hard to setup a simple contact group cause I cannot find any reference material anywhere. The best bet was to ask you guys.
On running which mailx, the path is /usr/bin/mailx
Where do I have to replace this ?
Yeah I understand that and that is part of the reason why it is so hard to setup a simple contact group cause I cannot find any reference material anywhere. The best bet was to ask you guys.
On running which mailx, the path is /usr/bin/mailx
Where do I have to replace this ?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Adding contacts and contact groups
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$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# '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: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}