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.
bshiers
Posts: 4 Joined: Fri Aug 10, 2018 11:18 am
Post
by bshiers » Fri Aug 10, 2018 11:24 am
I'm upgrading Nagios for a client from Version 1.2 up to Nagios Core 4.3.4 . I have everything working but the notifications properly. I'm not getting any INFO or the Date/Time in my notifications.
Here's what an old notification from the old system looks like:
Code: Select all
** Nagios Riverton **
Notification Type: PROBLEM
Host: Site
Name: Site2
State: DOWN
Address: x.x.x.x
Info: PING CRITICAL - Packet loss = 100%
Date/Time: Fri Aug 10 06:29:08 MDT 2018
Here’s what I’m getting from the new system (different host):
Code: Select all
** Nagios Riverton **
Notification Type: PROBLEM
Host: Site2
Name: Site3
State: DOWN
Address: y.y.y.y
Info: $
Date/Time: $
As you can see I'm not getting anything for Info and Date/Time.
Here is my notification command config:
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: $LO
NGHOSTOUTPUT$\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
cmmand_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nSt
ate: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$LONGSERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$
is $SERVICESTATE$ **" $CONTACTEMAIL$
}
I think I'm missing something very simple but I can't find it. Anything thoughts?
npolovenko
Support Tech
Posts: 3457 Joined: Mon May 15, 2017 5:00 pm
Post
by npolovenko » Fri Aug 10, 2018 3:36 pm
Hello,
@bshiers . I don't think your hosts/services are using the commands you included. The very first line in the notification message says:
** Nagios Riverton **
But according to the commands, it should be:
***** Nagios *****
Can you take a look at the contacts.cfg file and make sure that contacts are using the correct notification command?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new
Privacy Policy .
bshiers
Posts: 4 Joined: Fri Aug 10, 2018 11:18 am
Post
by bshiers » Fri Aug 10, 2018 3:52 pm
I did find a command that referenced the Nagios Riverton in
/var/objects.precache, but that's the only spot.
I've removed the cache and retention files and that's the only place it keeps coming back. Where next as I'm sure that's my issue. The contacts were not using the right notification but it's like the one from the old server is getting cached somewhere.
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by scottwilkerson » Fri Aug 10, 2018 4:18 pm
you could have muliple parent processes
If there are multiple parents run the following:
Code: Select all
service nagios stop
killall -9 nagios
service nagios start
bshiers
Posts: 4 Joined: Fri Aug 10, 2018 11:18 am
Post
by bshiers » Fri Aug 10, 2018 5:01 pm
I think I found the issue. The old config was using the miscommands.cfg file and not commands.cfg. I'm doing some testing now but I believe I have this fixed up.
bshiers
Posts: 4 Joined: Fri Aug 10, 2018 11:18 am
Post
by bshiers » Fri Aug 10, 2018 5:22 pm
Issue is fixed. Thanks all for your help. Overlooked this for awhile.
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by scottwilkerson » Mon Aug 13, 2018 7:12 am
bshiers wrote: Issue is fixed. Thanks all for your help. Overlooked this for awhile.
Great Locking