Hi Richard,

Opsview/Nagios command to send email is in the misccommands.cfg file in your nagios/configs directory.

# 'host-notify-by-email' command definition
define command{
       command_name host-notify-by-email
command_line /usr/bin/printf "%b" "$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$: $HOSTOUTPUT$\n\nHost: $HOSTNAME$\nAlias: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $HOSTSTATE$\nComment: $HOSTACKCOMMENT$ ($HOSTACKAUTHOR$)\nDate/Time: $LONGDATETIME$\nInfo: $HOSTOUTPUT$\n" | /usr/bin/Mail -s "$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$
}

# 'service-notify-by-email' command definition
define command{
       command_name service-notify-by-email
command_line /usr/bin/printf "%b" "$NOTIFICATIONTYPE$: $SERVICEDESC$ is $SERVICESTATE$ on host $HOSTNAME$: $SERVICEOUTPUT$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAlias: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nComment: $SERVICEACKCOMMENT$ ($SERVICEACKAUTHOR$)\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/Mail -s "$NOTIFICATIONTYPE$: $SERVICEDESC$ is $SERVICESTATE$ on $HOSTNAME$" $CONTACTEMAIL$
}

Due to this using the Mail command, there is no way that I have found to change the domain besides renaming the hostname server it self. As opsview runs as the nagios user, when it generates an email it sends it out as the nagios user. To change the user it is sending out as you will need to do 1 of 2 things, either add a monitoring user and tell opsview/nagios to run as that user or in the above configuration sections add "-u monitoring" and this should send the email out as that user.

But remember that the next time you update nagios via the opsview interface, this configuration file will be updated so you will need to make this change to the opsview template file too.

Hope this helps.

Joe

Richard Pijnenburg wrote:

Hi All,

I'm not sure if this was already asked but I couldn't find it that quick.

Is it possible to change the sender email address of opsview/nagios?

At this moment it sends like "nag...@hostnameoftheserver" and I want it to be "[email protected] <mailto:[email protected]>"

I couldn't find it in the system nor in the documentation.

I found in the nagios documentation an admin_email rule but the configuration is overwritten by opsview on reload.

Thanks for your time.

Kind regards,

Richard Pijnenburg

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

_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-users
_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to