You are here

Slave server is not sending anything to Postfix

6 posts / 0 new
Last post
nayax's picture
Slave server is not sending anything to Postfix


I successfully installed and connected 2 slaves to my master server.

The problem is, neither are sending out alerts and the Postfix logs are empty.

What did I miss?



Duncan Ferguson
dferguson's picture
Are both of those slaves

Are both of those slaves configured to send notifications, e.g. is the notification method set to be run on the master or the slaves? 

I take it these are email notifications?  If so, can you send an email manually on the servres without issue?

date | /usr/bin/Mail -s subject <email address>


nayax's picture
I found out what was missing

The Slave guide on your Knowledge Base does not mention installing "mailutils".

After installing it and changing the default email script from using "/usr/bin/Mail" to "/usr/bin/mail" the emails started reaching Postfix.

However, I have yet to find out how to add a "sender name" i.e "Opsview IL" to the emails being sent as they are all nameless.

Adding a name to the nagios\root\opsview user on the linux machine does not cut it. It still remains empty.

Is there a way to fix this or must I re-write the sending script?

btw, how come I can only see your last response to my message rather than the entire conversation on the Forum?

People might find this useful...


Duncan Ferguson
dferguson's picture
/usr/bin/Mail should be

/usr/bin/Mail should be available in another package (such as bsd-mailx on Debian) and you should not need to amend the script to get it working 'out of the box'.

I will check the package dependancies to see why this one was missed.

Also, amending the GCOS field in /etc/passwd is the right way to go when using Mail, otherwise 'mail' might have an option such as '-F Opsview' to override the default.


nayax's picture
GCOS field has been edited

GCOS field has been edited but I still dont get no sender name...

nagios:x:999:998:Opsview Master,,,:/var/log/nagios:/bin/bash
root:x:0:0:Opsview Master,,,:/root:/bin/bash

I also tried editing the notify_by_email script but that didnt work at all.
I dont have knowledge in PERL but I believe the relevant part should be something like this:

my $subject;
($subject) = ( $output =~ /^(.+)$/m );

open EMAIL, "|-", "/usr/bin/Mail", "-s", $subject, "-a From: Opsview IL <>", $email;
print EMAIL $output;
close EMAIL;

print "Sent email!\n";


Yet that does not work either...

Duncan Ferguson
dferguson's picture
Changing the part of the line

Changing the part of the line from

"-s", $subject, "-a From: Opsview IL .....


"-s", $subject, "-a","From: Opsview IL ....

may make a difference, but can you just run the command directly and get it to work?

date | /usr/bin/Mail -s subject -a "From: Opsview LS <>" email@address