It's me again.
A lot of my alerts currently look like the following:
-------------------------------------------------------
Notification Type: PROBLEM
Service: Application - Notepad
Host:
Address: 10.15.18.115
State: WARNING
Date/Time: Thu Aug 6 16:53:55 BST 2015
Additional Info:
No data was received from host!
-------------------------------------------------------
As you can see, there's nothing showing for the Host ID, even though I have a host_name entry containing my server name in both the define host{} sections of my windows.cfg.
define host{
use windows-server
host_name FICTITIOUSHOSTNAME
alias FICTITIOUSALIAS
address 99.99.99.99
hostgroups windows-servers
}
Any thoughts, anybody?
Missing Information from Nagios Core Alerts
-
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: Missing Information from Nagios Core Alerts
Can you post the notify-service-by-email command settings so we can review them?
It can be found in the commands.cfg file.
Can you post how the service check is defined for your example alert?
It can be found in the commands.cfg file.
Can you post how the service check is defined for your example alert?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: Missing Information from Nagios Core Alerts
Code: Select all
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Code: Select all
define host{
name windows-server ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, Windows servers are monitored round the clock
check_interval 5 ; Actively check the server every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each server 10 times (max)
check_command check-host-alive ; Default command to check if servers are "alive"
notification_period 24x7 ; Send notification out at any time - day or night
notification_interval 30 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
hostgroups windows-servers ; Host groups that Windows servers should be a member of
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}
Code: Select all
define host{
use windows-server
host_name FIRSTSERVER
alias FIRSTSERVER
address 88.88.88.88
hostgroups windows-servers
}
define host{
use windows-server
host_name SECONDSERVER
alias SECONDSERVER
address 99.99.99.99
hostgroups windows-servers
}
define hostgroup{
hostgroup_name windows-servers
alias Windows Servers
}
define service{
use generic-service
#host_name FIRSTSERVER, SECONDSERVER
hostgroup_name windows-servers
service_description Drive Space - C
check_command check_nt!USEDDISKSPACE!-l c -w 5 -c 10
}
Re: Missing Information from Nagios Core Alerts
Try changing the above to:Host: $HOSTALIAS$
Code: Select all
Host: $HOSTNAME$
-
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: Missing Information from Nagios Core Alerts
No, I'm afraid it didn't - the hostname is still missing from the alerts.
However, the diskspace alerts that I'm receiving from my two test servers are slightly different:
The first one shows the entry "alias" against Host and the subject of the message is ** PROBLEM Service Alert: alias/Drive Space - C is CRITICAL **
***** Nagios *****
Notification Type: PROBLEM
Service: Drive Space - C
Host: alias
Address: 88.88.88.88
State: CRITICAL
Date/Time: Mon Aug 10 14:33:18 BST 2015
Additional Info:
c:\ - total: 39.90 Gb - used: 24.99 Gb (63%) - free 14.91 Gb (37%)
The second one one shows nothing against Host and the subject of the message is ** PROBLEM Service Alert: /Drive Space - C is CRITICAL ** (without the "alias")
***** Nagios *****
Notification Type: PROBLEM
Service: Drive Space - C
Host:
Address: 99.99.99.99
State: CRITICAL
Date/Time: Mon Aug 10 15:01:43 BST 2015
Additional Info:
c:\ - total: 39.90 Gb - used: 28.61 Gb (72%) - free 11.29 Gb (28%)
It seems that the two servers are configured differently, but neither of them is sending out the correct alerts!
Cheers
Pete
However, the diskspace alerts that I'm receiving from my two test servers are slightly different:
The first one shows the entry "alias" against Host and the subject of the message is ** PROBLEM Service Alert: alias/Drive Space - C is CRITICAL **
***** Nagios *****
Notification Type: PROBLEM
Service: Drive Space - C
Host: alias
Address: 88.88.88.88
State: CRITICAL
Date/Time: Mon Aug 10 14:33:18 BST 2015
Additional Info:
c:\ - total: 39.90 Gb - used: 24.99 Gb (63%) - free 14.91 Gb (37%)
The second one one shows nothing against Host and the subject of the message is ** PROBLEM Service Alert: /Drive Space - C is CRITICAL ** (without the "alias")
***** Nagios *****
Notification Type: PROBLEM
Service: Drive Space - C
Host:
Address: 99.99.99.99
State: CRITICAL
Date/Time: Mon Aug 10 15:01:43 BST 2015
Additional Info:
c:\ - total: 39.90 Gb - used: 28.61 Gb (72%) - free 11.29 Gb (28%)
It seems that the two servers are configured differently, but neither of them is sending out the correct alerts!
Cheers
Pete
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Missing Information from Nagios Core Alerts
Are there any special characters in the hostnames in question? Do any hosts work properly?
-
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: Missing Information from Nagios Core Alerts
Good afternoon!
Problem now appears to be solved - i just retyped the define hosts sections of windows.cfg
Maybe I copied in some rogue character, but both hosts are now returning the correct alias and IP address.
Thank you for taking the time to look at my post - much appreciated.
Pete
Problem now appears to be solved - i just retyped the define hosts sections of windows.cfg
Maybe I copied in some rogue character, but both hosts are now returning the correct alias and IP address.
Thank you for taking the time to look at my post - much appreciated.
Pete
Re: Missing Information from Nagios Core Alerts
Thank you for the follow up. Is it all right if I lock this thread?
Former Nagios Employee.
me.
me.