Page 3 of 4

Re: Nagios map setting issue 4.3.2

Posted: Tue Jun 26, 2018 6:41 am
by scottwilkerson
It is for Case 2 that my recommendations would matter.

Can you send your .cfg files and the name of at least one contact receive these and I can suggest a fix.

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 1:34 am
by jagannathan
scottwilkerson wrote:

It is for Case 2 that my recommendations would matter.

Can you send your .cfg files and the name of at least one contact receive these and I can suggest a fix

-> Here you are mentioning .cfg files means : commands.cfg file ?

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 7:02 am
by scottwilkerson
jagannathan wrote:
scottwilkerson wrote:It is for Case 2 that my recommendations would matter.

Can you send your .cfg files and the name of at least one contact receive these and I can suggest a fix
-> Here you are mentioning .cfg files means : commands.cfg file ?
Yes please

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 7:54 am
by jagannathan
'' scottwilkerson wrote:

-> Ya whatever your are saying correct commands.cfg file only fetching the mail configuration parameter, but it will send both the case 1 ,as well as case 2 .

->For my doubt exactly case 2 : Automatical mail sending time that particular comment parameter only remove remaining all parameter should pass for that automatic case also.

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 7:57 am
by scottwilkerson
I don't understand, are you attaching the file?

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 9:12 am
by jagannathan
Hello Folks,

mail alerts Notification problem time : comment parameter need to remove is there any possible.

Re: Nagios map setting issue 4.3.2

Posted: Wed Jun 27, 2018 9:16 am
by scottwilkerson
please attach commands.cfg

Re: Nagios map setting issue 4.3.2

Posted: Thu Jun 28, 2018 12:28 am
by jagannathan
Hello scottwilkerson ,

-> Here i attached commands.cfg file ,once verify those file and give me solution for fixing this mail alert issue.
commands.cfg
(7.57 KiB) Downloaded 558 times
.

Re: Nagios map setting issue 4.3.2

Posted: Thu Jun 28, 2018 7:12 am
by scottwilkerson
So, if you don't want the Comment: to show up you need to change the following 2 commands at the top of this file
from this

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$\nComment: $NOTIFICATIONCOMMENT$ \n" | /usr/bin/mail -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 Comment : $NOTIFICATIONCOMMENT$ \n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ }  


to this

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/mail -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/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ }  


Re: Nagios map setting issue 4.3.2

Posted: Thu Jun 28, 2018 8:47 am
by jagannathan
Scottwilkerson wrote :

-> Ya whatever your are saying is correct notification host by mail under passing parameter it will fetch the email alert i agree , but it should pass for all the scenario , previous post i already discussed for 2 cases
1st case it should be ok , but whenever moving to 2nd case comment no need to pass that is my exact question ?