Unable to query NTP service

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.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Unable to query NTP service

Post by imran_khan »

Hello,

I am using Check_windows_time.bat plugin to monitor windows servers time in Nagios but am getting below unknown error frequently for all the servers. Please suggest me to fix this unknown error.

UNKNOWN: Unable to query NTP service at NTPServerName (Port 123 blocked/closed)

http://exchange.nagios.org/directory/Pl ... 29/details

Thanks,
Imran Khan.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Unable to query NTP service

Post by eloyd »

Can you share with us the exact command that you are executing?

Has it ever worked?

If it has, what's changed?

The "Port 123 blocked" message indicates that the NTP server you're trying to query either doesn't let you connect or there is a firewall port that needs to be opened.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Unable to query NTP service

Post by imran_khan »

Hello,

NTP port 123 is not blocked in firewall. Plugin is working fine but frequently time service is showing in unknown error section.

Command:-
define command{
command_name check_windows_time
command_line $USER1$/check_nrpe -t 30 -H $HOSTADDRESS$ -c check_windows_time -a $ARG1$ $ARG2$ $ARG3$
}

Nsc.ini entry:-
check_windows_time=C:\Nagios++\scripts\check_windows_time.bat $ARG1$ $ARG2$ $ARG3$

Command in service file:-
check_command check_windows_time!time.windows.com!60!180

Thanks,
Imran Khan.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Unable to query NTP service

Post by eloyd »

How often are you checking? Microsoft may be rate limiting you on their end, thinking that you're trying to DOS them, and essentially block you with their version of fail2ban for some time.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Unable to query NTP service

Post by imran_khan »

Hello,

Where I can check this?

Limiting limit might be the issue, because I have changed NTP server name from time.windows.com to pool.ntp.org then unknown error time is increased but still it is going in unknown section.

Thanks,
Imran Khan.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Unable to query NTP service

Post by eloyd »

This is just a guess. I do not know for sure. You might want to open a ticket with Microsoft to ask.

Or you can increase your time between checks so that you are not constantly checking Microsoft's time server. It really is not a big deal to not be able to communicate with an NTP time server. Once the time has been synchronized, very few adjustments need to be made. You could probably check once per day and it will still be a valid check.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Unable to query NTP service

Post by imran_khan »

Hello,

How often this plugin checking? We have to sync/check time of all the servers continuously.

Thanks,
Imran Khan.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Unable to query NTP service

Post by eloyd »

But this plugin is no syncing time, it is checking that a time server is available. Your NTP client running on the machine can run for hours or even days without drifting more than a second off of real time. So what I am suggesting is that time.microsoft.com may see you testing it every minute or two minutes or five minutes from all of your hosts, and think initiate some sort of rate limiting.

I am suggesting that you change your check_ntp to be more like once every four hours.

What you should be checking at small intervals is that your NTP client is working, not the NTP server.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Unable to query NTP service

Post by imran_khan »

Hello,

I am monitoring windows servers time in nagios using check_windows_time not check_ntp plugin.
Is there any time setting for check_windows_time plugin?

Thanks,
Imran Khan.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Unable to query NTP service

Post by eloyd »

I think we're getting off topic. I am saying that you are checking the NTP server time.windows.com frequently, and maybe Microsoft is rate limiting you for checking so often, and therefore, you are getting added to a temporary firewall rule of theirs. This would cause the symptom that you're seeing.

Because of this, I am suggesting that you change the check_interval from a few minutes to a few hours and see if that helps.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked