Page 1 of 1

Nagios XI templates

Posted: Thu Jan 11, 2018 7:33 am
by junkertf
Hello,

I am almost new to Nagios, and have some questions about templates and services on XI platform.
I know, that XI customers has a different topic, but i can not post it there. Any help, how i there a new topic open can, will be appreciated.

We use XI 5.4.11 with online installed environment (proxy settings are also in use). OS REHL 7.4.
I configured one monitored host and try to use service template on it.

The configuration steps was:
- Configure host with wizard (Linux host) and add some other service check also. (ntp time check)
- Configured a service template for ntp check.
- switched the service template on configured host to use the newly created template

At this point i recognized, that the service check was out of bound of the template,
(its working well, because the parameters configured on the object has proirity over the parameters used in template)

So i corrected the service paramters and deleted the warning and critical limits from that check active on that object.
(The template is still active on the service)

After that for testing pourposes i corrected the template warn limit to check the config working well.
It had worked well, the warning event occured.

Lastly i want to switch back the warn limit to a higher value, what was also success.
My problem, that the service after that setting not goes back to OK state. (Actually it is still in Warn state)

Can you help me with some advices what i made wrong?

Thank you, regards,

Ferenc

Re: Nagios XI templates

Posted: Thu Jan 11, 2018 1:24 pm
by npolovenko
Hello, @junkertf .
I know, that XI customers has a different topic, but i can not post it there. Any help, how i there a new topic open can, will be appreciated.
You need to email with your username to [email protected] and mention that you want to have access to the customer forum.
My problem, that the service after that setting not goes back to OK state. (Actually it is still in Warn state)
Can you go to the service detail and force an immediate check. Would the status still be Warning?
I would like to see the output of the check(maybe a screenshot), also I would like to see the service definition and the template, please.

Re: Nagios XI templates

Posted: Fri Jan 12, 2018 7:17 am
by junkertf
Hello,

Yes, i tried (actually many times) to force the immediate check without any success... It is still in Warning...

Output string:

NTP WARNING: Offset 0.01919054985 secs
(Attached also a sniffed picture about it!)

service definition from file nagios/etc/services/hostname.cfg

define service {
host_name hostname
service_description NTPd Sync State
use BB_NIX_LINUX_NTPd
check_command check_ntp_time!!!!!!!!
max_check_attempts 2
check_interval 3
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contact_groups CG_NIX
_xiwizard linux-server
register 1
}



template definition from nagios/etc/services/servicetemplates.cfg

define service {
name *NIX_LINUX_NTPd
host_name hostname
service_description NTPd Sync State
use xiwizard_generic_service
check_command check_ntp_time!0.15!0.5!!!!!!
max_check_attempts 2
check_interval 3
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options c,u,r,f,s,
contact_groups CG_NIX
_xiwizard linux_server
register 0

}

Thank you, best regards,

Ferenc

Re: Nagios XI templates

Posted: Fri Jan 12, 2018 1:56 pm
by npolovenko
@junkertf, Please navigate to the Core Configurations manager and click on "Apply Configuration". Do you get a success message?
Also, please navigate to

Code: Select all

/usr/local/nagios/libexec/ 
And run the following commands:

Code: Select all

./check_ntp_time -H  paste_host_ip_here -w 0.15 -c 0.5

Code: Select all

./check_ntp_time -H  paste_host_ip_here
And show us the output.
What happens when you click on "Run Check Command" inside the service menu in Core Configurations Manager?
edit fused.png

Re: Nagios XI templates

Posted: Mon Jan 15, 2018 2:04 am
by junkertf
Hello,

I had made Apply configuration many times, without any error...

The outputs you want is there:

[root@nagiosxi libexec]# ./check_ntp_time -H 3.193.250.9 -w 0.15 -c 0.5
NTP OK: Offset 0.01851892471 secs|offset=0.018519s;0.150000;0.500000;
[root@nagiosxi libexec]# ./check_ntp_time -H 3.193.250.9
NTP OK: Offset 0.01879251003 secs|offset=0.018793s;60.000000;120.000000;

Lets see the graphical output's attached to the post.
ntp_check_param.PNG
ntp_check_run.PNG
regards,

Ferenc

Re: Nagios XI templates

Posted: Mon Jan 15, 2018 1:45 pm
by dwhitfield
Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh

That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44

UPDATE: profile received

Re: Nagios XI templates

Posted: Tue Jan 16, 2018 2:37 am
by junkertf
Hello,

I had send a PM for you with the asked output.

Regards,

Ferenc

Re: Nagios XI templates

Posted: Tue Jan 16, 2018 3:48 pm
by tgriep
What is happening is that you specified the check command in the service which stops the inheritance of the Arguments from passing from the template to the object.
So, remove the check command from the object and save and apply the config.
That will allow the command and arguments to be passed to the object from the template which will pick up the warning and critical thresholds and give you the correct states.

Try that and let us know how it works out.

Re: Nagios XI templates

Posted: Wed Jan 17, 2018 2:49 am
by junkertf
Hello,

WOW... !!! :) So simply...

Thank You, it is worked so way well! I had made a immediate check, and the result come up in OK state right now!
Question solved, thank you again!

Best regards,

Ferenc

Re: Nagios XI templates

Posted: Wed Jan 17, 2018 12:48 pm
by npolovenko
Well said, @tgriep! I will close this thread as resolved.