SMS From User Setting

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

SMS From User Setting

Post by asmgiadmin »

I've configured SMS Alerts as follows:

Code: Select all

/usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$" | /bin/mail $CONTACTPAGER$
How can I configure user sent from? curently being received as [email protected]
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SMS From User Setting

Post by scottwilkerson »

It will depend on the mail version on your ststem, but you may be able to add the -r flag

ie

Code: Select all

/usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$" | /bin/mail -r [email protected] $CONTACTPAGER$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: SMS From User Setting

Post by asmgiadmin »

yes, -r flag did work, but it appears I do not need those commands.

I've discovered xi_host_notification_handler

Code: Select all

/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"
and

xi_service_notification_handler

Code: Select all

/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
How can I change from address? I've noticed in /usr/local/nagios/etc/nagios.cfg

# MODIFIED
admin_email=[email protected]
admin_pager=[email protected]
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SMS From User Setting

Post by slansing »

The from address is changed from the following page:

Code: Select all

Admin > Manage Email Settings
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: SMS From User Setting

Post by asmgiadmin »

Set to use sendmail.

How can I change the user alerts are sent from?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SMS From User Setting

Post by slansing »

That is the page in Nagios XI where you can change the Sent From address.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: SMS From User Setting

Post by asmgiadmin »

got it.

FYI - If from address is invalid, it seems that default [email protected] is used.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SMS From User Setting

Post by slansing »

Glad to hear you got it working. Thanks for letting us know!
Locked