I wanted to add an account in mailx for my Nagios setup. Could not find any docs on it (maybe I didnt search enough) but here we go: The config file: /etc/mail.rc Just added an new account to the end of the file like such account newsmtp { set record=+Sent set from="Administrator " set smtp=smtp://smtp-relay.blah.com:25 } Viola I can now in my commands.cfg config of nagios: (/usr/local/nagios/etc/objects) just add the -A projsmtp to use this account in the mail setup # '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" | /bin/mail -A newsmtp -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ } # 'notify-se...
The Incident Archive: A blog to store my knowledge on the errors that I fix on a daily basis