It seems that i have figured out the error:
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nHOSTGROUP: $HOSTGROUPNAMES\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
There was one $ missing in the command after the HOSTGROUPNAMES. Now i have added $ after the HOSTGROUPNAMES. will see monitor it for some time.
Email is not getting generated for some cases
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email is not getting generated for some cases
that would do it!amitgupta19 wrote:It seems that i have figured out the error:
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nHOSTGROUP: $HOSTGROUPNAMES\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
There was one $ missing in the command after the HOSTGROUPNAMES. Now i have added $ after the HOSTGROUPNAMES. will see monitor it for some time.
Let us know how it turns out
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Email is not getting generated for some cases
yes it is working now.
Thanks for your support
Thanks for your support
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email is not getting generated for some cases
Great!amitgupta19 wrote:yes it is working now.
Thanks for your support
Locking thread