Nagios Core

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios Core

Postby 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?
bshiers
 
Posts: 4
Joined: Fri Aug 10, 2018 11:18 am

Re: Nagios Core

Postby 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.
User avatar
npolovenko
Support Tech
 
Posts: 2101
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Core

Postby 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.
bshiers
 
Posts: 4
Joined: Fri Aug 10, 2018 11:18 am

Re: Nagios Core

Postby scottwilkerson » Fri Aug 10, 2018 4:18 pm

you could have muliple parent processes
Code: Select all
ps -ef|grep nagios.cfg


If there are multiple parents run the following:
Code: Select all
service nagios stop
killall -9 nagios
service nagios start
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12048
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios Core

Postby 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

Re: Nagios Core

Postby bshiers » Fri Aug 10, 2018 5:22 pm

Issue is fixed. Thanks all for your help. Overlooked this for awhile.
bshiers
 
Posts: 4
Joined: Fri Aug 10, 2018 11:18 am

Re: Nagios Core

Postby scottwilkerson » Mon Aug 13, 2018 7:12 am

bshiers wrote:Issue is fixed. Thanks all for your help. Overlooked this for awhile.


Great Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12048
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 15 guests