Hostname not showing up in email notification
-
luniversity
- Posts: 56
- Joined: Mon Dec 10, 2012 9:39 am
Hostname not showing up in email notification
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.
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.
You do not have the required permissions to view the files attached to this post.
Mike Westmoreland
Lamar University
Lamar University
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Hostname not showing up in email notification
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?
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
luniversity
- Posts: 56
- Joined: Mon Dec 10, 2012 9:39 am
Re: Hostname not showing up in email notification
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?
All users are full XI users.
And I believe we are using SMTP but I'm not sure. How can I verify that?
Mike Westmoreland
Lamar University
Lamar University
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Hostname not showing up in email notification
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
luniversity
- Posts: 56
- Joined: Mon Dec 10, 2012 9:39 am
Re: Hostname not showing up in email notification
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:
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:Subject: PROBLEM Service Alert - // Disk Usage is WARNING
***** Nagios XI Alert *****
Nagios has detected a problem with this service.
Notification Type: PROBLEM
Service: / Disk Usage
Host:
Address: 192.168.245.20
State: WARNING
Info:
DISK WARNING - free space: / 2859 MB (20% inode=95%):
Date/Time: 2014-07-25 11:19:58
Respond: https://nagios.lamar.edu/nagiosxi//rr.p ... 21a5594f50
Nagios URL: https://nagios.lamar.edu/nagiosxi/
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%
Mike Westmoreland
Lamar University
Lamar University
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Hostname not showing up in email notification
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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
luniversity
- Posts: 56
- Joined: Mon Dec 10, 2012 9:39 am
Re: Hostname not showing up in email notification
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
#
###############################################################################
Mike Westmoreland
Lamar University
Lamar University
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Hostname not showing up in email notification
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.
Code: Select all
alias As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
luniversity
- Posts: 56
- Joined: Mon Dec 10, 2012 9:39 am
Re: Hostname not showing up in email notification
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:
I looked at the config file '/usr/local/nagios/etc/contactgroups.cfg' and line 50 shows this:
I'll post this issue on a separate thread and try again.
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!
Code: Select all
50 define contactgroup {
51 contactgroup_name DBA
52 alias LU DBAs
53 members nelsong,ppilli1,swilkins
54 }
Mike Westmoreland
Lamar University
Lamar University
Re: Hostname not showing up in email notification
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
Admin->System Profile->Download Profile
Be sure to check out our Knowledgebase for helpful articles and solutions!