Page 1 of 1
Last Check Date Correct
Posted: Fri Aug 12, 2016 2:46 pm
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
Re: Last Check Date Correct
Posted: Mon Aug 15, 2016 9:51 am
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?
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 8:48 am
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
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 9:54 am
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?
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 10:22 am
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
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 10:38 am
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.
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 10:52 am
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
Re: Last Check Date Correct
Posted: Tue Aug 16, 2016 11:13 am
by lmiltchev
I am glad I could help, Berto!
