Missing Information from Nagios Core Alerts

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.
Locked
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Missing Information from Nagios Core Alerts

Post by neworderfac33 »

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?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Missing Information from Nagios Core Alerts

Post by tgriep »

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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Missing Information from Nagios Core Alerts

Post by neworderfac33 »

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$
}
Here's the windows-server part of templates.cfg

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
        }

Here're the hosts and service definition from windows.cfg

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
       }

jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Missing Information from Nagios Core Alerts

Post by jolson »

Host: $HOSTALIAS$
Try changing the above to:

Code: Select all

Host: $HOSTNAME$
Does that make a difference regarding the results you receive?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Missing Information from Nagios Core Alerts

Post by neworderfac33 »

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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Missing Information from Nagios Core Alerts

Post by jdalrymple »

Are there any special characters in the hostnames in question? Do any hosts work properly?
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Missing Information from Nagios Core Alerts

Post by neworderfac33 »

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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Missing Information from Nagios Core Alerts

Post by hsmith »

Thank you for the follow up. Is it all right if I lock this thread?
Former Nagios Employee.
me.
Locked