Page 1 of 1

check_ntp_time command define without in nagios client

Posted: Tue Feb 02, 2021 8:22 am
by informatica
Hi Team,

i) we would like to monitor check_ntp_time on remote client, for this with out defining the command in client do we have any other option ?

ii) if we want to monitor check_ntp_time we need to define the command in client. we have defined command at server like below in client.

At client:
command[check_ntp_time]=/usr/local/nagios/libexec/check_ntp_time -H NTPserver.

In Nagios server:
$USER1$/check_nrpe -2 -H XXXXX -t 60 -u -c check_ntp_time -u

Do we have option without defining at client end which we can define at nagios server only??? Because we need to disturb persons for the all config changes in client end.

What is the better options we have at client end??

Re: check_ntp_time command define without in nagios client

Posted: Tue Feb 02, 2021 6:21 pm
by ssax
i) You are using nsclient++, you will need to define it manually like you did.
-- If you use NCPA you can put the plugin on there and then just call it without defining anything but that would require you converting everything to NCPA
-- If you use NRDS you can setup centralized configs and automatic downloading of the plugins but you will need to set it up and define them on the XI server, see here: https://assets.nagios.com/downloads/nag ... DS-Win.pdf

ii) See above, you can only do this with NRDS at this time (centralized configs). NCPA just requires the plugin to exist on the remote system, all commands would be defined on the XI server so that is another option that doesn't allow you to touch the configs on the remote system.

NSClient++ requires you manually define them.

Re: check_ntp_time command define without in nagios client

Posted: Wed Feb 03, 2021 3:06 am
by informatica
we have nrpe for linux system, for this what are the steps we should follow.

Do we need copy the plugin check_ntp_time in nagios client ??
Do we need define command in nrpe.cfg in nagios client ??
Do we need define command in nagiosxi to call defined command in nagios client??

please suggest on this.

Re: check_ntp_time command define without in nagios client

Posted: Wed Feb 03, 2021 6:30 pm
by ssax
Sorry about that, I misread, the same information is still true whether using nsclient++ on windows/linux or NRPE on linux. NRDS is still the only centralized configs/plugins solution at this time for both linux/windows.
Do we need copy the plugin check_ntp_time in nagios client ??
Only if the plugin doesn't exist on the system, if you installed NRPE using this utility it should already exist:

https://assets.nagios.com/downloads/nag ... _Agent.pdf
Do we need define command in nrpe.cfg in nagios client ??
Yes, it is not defined by default in NRPE.

If you want to pass the NTP host as an argument you would use this:

Code: Select all

command[check_ntp_time]=/usr/local/nagios/libexec/check_ntp_time -H $ARG1$
And call it like this:
- Y.Y.Y.Y is your NTP server IP

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H X.X.X.X -c check_ntp_time -a Y.Y.Y.Y
If you don't want to pass the NTP host as an argument you could hardcode it like this:

Code: Select all

command[check_ntp_time]=/usr/local/nagios/libexec/check_ntp_time -H Y.Y.Y.Y
Then call it like this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H X.X.X.X -c check_ntp_time
Do we need define command in nagiosxi to call defined command in nagios client??
You need to setup a service, then choose check_nrpe for the check command and set these:
- NOTE: You would only set $ARG2$ if you are passing the NTP host as an argument

Code: Select all

$ARG1$: check_ntp_time
$ARG2$: Y.Y.Y.Y
Then set the rest of the settings (you can use one of your other services as an reference), save, and apply configuration.

Re: check_ntp_time command define without in nagios client

Posted: Wed Feb 10, 2021 12:03 am
by informatica
Does check_ntp_time have capability take multiple NTP servers as argument, because we have multiple ntp servers (A,B,C).

If A down by any chance does check_ntp_time B, C ????

Re: check_ntp_time command define without in nagios client

Posted: Wed Feb 10, 2021 6:55 pm
by ssax
check_ntp_time doesn't currently have that failover/multi-NTP-host functionality. I was also unable to find any third party ones that do that either. You would either need to write one or modify an existing one if you're able.

You could use a plugin like this which would alert you if the ntpd service isn't running, isn't synchronized, or if the offset is greater than a threshold as an alternative:

https://exchange.nagios.org/directory/P ... ux/details