Page 1 of 1
Hostname not showing up in email notification
Posted: Fri Jul 25, 2014 12:15 pm
by luniversity
profile.txt
I'm new to Nagios and have just taken over our system and I need a little help fixing an issue. I have about 15 hosts which do not display the host_name in either in subject or the body of the email in notifications when an alert is triggered.
I've looked through the FAQ's and searched the forum but still no luck finding a solution to my problem. Can anyone give me any ideas on where to look?
I've attached the output for my system profile.
Re: Hostname not showing up in email notification
Posted: Fri Jul 25, 2014 12:52 pm
by sreinhardt
Does this happen for all users that would get notified for these devices or just some of the users?
Also I should ask, are these just core config manager contacts, or full XI users?
finally, for the moment, are you using sendmail or smtp for sending alerts?
Re: Hostname not showing up in email notification
Posted: Fri Jul 25, 2014 1:51 pm
by luniversity
Yeah all the users that receive the notification see the same thing. The hostname is missing.
All users are full XI users.
And I believe we are using SMTP but I'm not sure. How can I verify that?
Re: Hostname not showing up in email notification
Posted: Fri Jul 25, 2014 1:58 pm
by sreinhardt
Since they are all users, smtp settings would be in Admin-Manage Email Settings. Could you give an example of a user and the service causing the issue? Also just to confirm, what should be hostname is not showing as an IP, it is just missing entirely correct?
Re: Hostname not showing up in email notification
Posted: Fri Jul 25, 2014 3:27 pm
by luniversity
I was wrong, the mail settings show sendmail.
An expample is would be my user account (cmwestmorel) is an admin account which is setup to receive alerts from all the hosts. The particular email I get looks some thing like this:
This service checks disk usage on the root (/) of this Linux host (RHEL 4) btdwappprod.lamar.edu. When I go to Admin -> Notification management my setting under the email tab look like this:
Host Alert Subject: %type% Host Alert - %hostalias% is %hoststate%
Host Alert Message:
Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Service Alert Subject:
%type% Service Alert - %hostalias%/%service% is %servicestate%
Service Alert Message:
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %hostalias%
Address: %hostaddress%
State: %servicestate%
Info:
%serviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Hostname not showing up in email notification
Posted: Sun Jul 27, 2014 4:30 pm
by Box293
I would like to see the host defintion please.
- CCM
Hosts
Find the host btdwappprod.lamar.edu
Click the icon that looks like a floppy disk
Upload this file here or paste it into a code block
Re: Hostname not showing up in email notification
Posted: Mon Jul 28, 2014 6:56 pm
by luniversity
Here is the host config:
Code: Select all
###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-07-28 18:54:57
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define host {
host_name btdwappprod.lamar.edu
use xiwizard_linuxserver_host
alias
address 192.168.245.20
parents nagios-server
hostgroups DegreeWorks
max_check_attempts 5
check_interval 5
retry_interval 1
contact_groups Application Admins,DegreeWorks,Enterprise Systems
notification_interval 720
first_notification_delay 0
notification_options d,u,r,f,s,
notifications_enabled 1
icon_image redhat.png
_xiwizard linux-server
register 1
}
###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
Re: Hostname not showing up in email notification
Posted: Mon Jul 28, 2014 8:00 pm
by Box293
I suspect that the alias field for this host is populated with some whitespace which is causing the problem.
Go and check that the alias field for the host is completely empty, save the host object and then apply config.
Re: Hostname not showing up in email notification
Posted: Tue Jul 29, 2014 1:28 pm
by luniversity
Well now I have another issue, not sure it's related. When I went into CCM and edit the host "Description" field (which was blank) I save it. But when I hit "Apply Configuration" I get a "Configuration verification failed" error. The snapshot of the configuration shows theses errors at the end of the file:
Code: Select all
Error: Could not find any contact matching '`÷®' (config file '/usr/local/nagios/etc/contactgroups.cfg', starting on line 50)
Error: Could not expand member contacts specified in contactgroup (config file '/usr/local/nagios/etc/contactgroups.cfg', starting on line 50)
Error processing object config files!
I looked at the config file '/usr/local/nagios/etc/contactgroups.cfg' and line 50 shows this:
Code: Select all
50 define contactgroup {
51 contactgroup_name DBA
52 alias LU DBAs
53 members nelsong,ppilli1,swilkins
54 }
I'll post this issue on a separate thread and try again.
Re: Hostname not showing up in email notification
Posted: Tue Jul 29, 2014 2:55 pm
by lmiltchev
Are all these (nelsong,ppilli1,swilkins) valid contacts? I would be probably easier if you sent the profile.zip to
[email protected] for review.
Admin->System Profile->Download Profile