Last Check Date Correct

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Last Check Date Correct

Post by Berto »

I noticed today that on one of our Nagios servers the "Last Check" date is off by a lot and it's on a multiple of servers being monitored. I uploaded a screenshot of one of them and on the server having issues I ran /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg and it came back with nor errors or warnings. I checked the other server and it looks fine and both are on 5.2.9.

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1891 services.
Checked 227 hosts.
Checked 5 host groups.
Checked 3 service groups.
Checked 20 contacts.
Checked 5 contact groups.
Checked 132 commands.
Checked 27 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 227 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 27 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Last Check Date Correct

Post by lmiltchev »

Is the PHP and system time in sync? Go to Admin->System Profile->Show Profile, and show us the info under the "Date/Time" section.

Can you also show us the actual config for this object? Does the "Last Check" time change if you force an immediate check?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Last Check Date Correct

Post by Berto »

Good Morning,

The PHP and system time are in sync and I've upload a screenshot of that. I have also uploaded the service configuration file for this host along with the host configuration file. I did try an immediate check and that "Last Check" time did not update, just the "Next Check" time.

--Berto
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Last Check Date Correct

Post by lmiltchev »

I don't see a "check_command" directive for the "lncpu0201.gcsd.harris.com" host. There is no "use" directive either, so the "check_command" could not be inherited from a template... Without check command, nagios wouldn't know how to perform the check.

Also, can you post the "unixopenoncall_notification_times" timeperiod config?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Last Check Date Correct

Post by Berto »

Here is the timeperiod config you asked for:

define timeperiod {
timeperiod_name unixopenoncall_notification_times
alias Notification Times for unixopenoncall
saturday 00:00-24:00
friday 00:00-24:00
thursday 00:00-24:00
wednesday 00:00-24:00
tuesday 00:00-24:00
monday 00:00-24:00
sunday 00:00-24:00
}

I did notice on the server having issues that there wasn't a "check_command" directive nor a "use" directive either. So I went to the Nagios server that is working and noticed it didn't have a "check_command" either yet it doesn't have the same issue. I upload the host and service config files from the working Nagios server. Below is the timeperiod config for the "unixopenoncall_notification_times" on the working Nagios server.
define timeperiod {
timeperiod_name unixopenoncall_notification_times
alias Notification Times for unixopenoncall
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Last Check Date Correct

Post by lmiltchev »

So I went to the Nagios server that is working and noticed it didn't have a "check_command" either yet it doesn't have the same issue.
The host doesn't have a "check_command" defined, but it uses the "xiwizard_linuxserver_host" host template...
define host {
host_name lncpu0201.gcsd.harris.com
use xiwizard_linuxserver_host
alias WKM EIT CPU PROD VGon509 CC:wpg
address 172.23.152.21
max_check_attempts 5
check_interval 10
retry_interval 1
check_period unixopenoncall_notification_times
contacts nagiosadmin,unixopenoncall
notification_interval 30
notification_period unixopenoncall_notification_times
notification_options d,u,r,
icon_image redhat.png
statusmap_image redhat.png
_xiwizard linux-server
register 1
}
If you haven't modified the "xiwizard_linuxserver_host" default template, it would look like this:

Code: Select all

define host {
       name                          		xiwizard_linuxserver_host
       check_command                 		check_xi_host_ping!3000.0!80%!5000.0!100%!!!!
       use                           		my_custom_template
       contact_groups                		admins
       register                    		0

}
As you can see, it uses the "check_xi_host_ping" command (which uses "check_icmp")... So, you do have a valid "check_command" for "lncpu0201.gcsd.harris.com", but you don't have one for "lncpu0201.gcsd.harris.com"...

Go to the CCM->Hosts->lncpu0201.gcsd.harris.com->Manage Templates, select "xiwizard_linuxserver_host", click on "Add Selected", Save, Apply Configuration.

Schedule a forced immediate check on this host. Let us know if the "Last Check" time updated.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Last Check Date Correct

Post by Berto »

Well that was it!! Now I need to understand how that could have happen since I don't ever remember making any changes on that server that could have done that. Thanks again, this thread can be closed.

--Berto
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Last Check Date Correct

Post by lmiltchev »

I am glad I could help, Berto! :)
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked