Nagios map setting issue 4.3.2

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios map setting issue 4.3.2

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jagannathan
Posts: 26
Joined: Sat Jun 16, 2018 7:21 am

Re: Nagios map setting issue 4.3.2

Post 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 ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios map setting issue 4.3.2

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jagannathan
Posts: 26
Joined: Sat Jun 16, 2018 7:21 am

Re: Nagios map setting issue 4.3.2

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios map setting issue 4.3.2

Post by scottwilkerson »

I don't understand, are you attaching the file?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jagannathan
Posts: 26
Joined: Sat Jun 16, 2018 7:21 am

Re: Nagios map setting issue 4.3.2

Post by jagannathan »

Hello Folks,

mail alerts Notification problem time : comment parameter need to remove is there any possible.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios map setting issue 4.3.2

Post by scottwilkerson »

please attach commands.cfg
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jagannathan
Posts: 26
Joined: Sat Jun 16, 2018 7:21 am

Re: Nagios map setting issue 4.3.2

Post 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 381 times
.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios map setting issue 4.3.2

Post 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$ }  

Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jagannathan
Posts: 26
Joined: Sat Jun 16, 2018 7:21 am

Re: Nagios map setting issue 4.3.2

Post 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 ?
Locked