Service definition issue

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.
Locked
as300182
Posts: 36
Joined: Tue May 17, 2016 8:09 am

Service definition issue

Post by as300182 »

I'm using Nagios core ver 4.2.2. I went to this link (https://assets.nagios.com/downloads/nag ... ml#service) to look at the documentation for service definitions to check something out and got a bit of a shock. The documentation reads as follows:

Definition Format:

Note: Directives in red are required, while those in black are optional.

define service{
host_name host_name
hostgroup_name hostgroup_name
service_description service_description
display_name display_name
parents service_descriptions
hourly_value #
servicegroups servicegroup_names
is_volatile [0/1]
check_command command_name
initial_state [o,w,u,c]
max_check_attempts #
check_interval #
retry_interval #

active_checks_enabled [0/1]
passive_checks_enabled [0/1]
check_period timeperiod_name
obsess_over_service|obsess [0/1]
check_freshness [0/1]
freshness_threshold #
event_handler command_name
event_handler_enabled [0/1]
low_flap_threshold #
high_flap_threshold #
flap_detection_enabled [0/1]
flap_detection_options [o,w,c,u]
process_perf_data [0/1]
retain_status_information [0/1]
retain_nonstatus_information [0/1]
notification_interval #
first_notification_delay #
notification_period timeperiod_name
notification_options [w,u,c,r,f,s]
notifications_enabled [0/1]
contacts contacts
contact_groups contact_groups

stalking_options [o,w,u,c]
notes note_string
notes_url url
action_url url
icon_image image_file
icon_image_alt alt_string
}

Does this documentation apply to ver 4.2.2 or only the latest ver 4.3.1? If 'NO' where can I see documentation for version 4.2.2 please?

The reason I ask is that my service definitions currently look like this:

define service{
use generic-service,nagiosgraph
host_name cam-posa-prod
service_description Prima
check_command check_nrpe!check_proc_prima
contact_groups primaadmins
_guide http://wiki.internal/Sysadmin/InfoEmerg ... Primatools
_priority 2
}

Based on the current documentation, I'm using 3 directives that no longer exist and I'm missing 7 directives that are supposedly required. Strangely my service definitions still work, although I don't understand how.
  • What has happened to 'use', '_guide', and '_priority'?
    If they are still valid why aren't they in the documentation?
    If they are not valid, what has replaced them?
    Is there a table somewhere that shows what directives have been replaced and by what?
I can no longer do any work on my services until I understand what's going on here. Please advise someone?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service definition issue

Post by cdienger »

Greetings,

6 of the 7 required directives(all but 'contacts') are inherited from the generic-service template. The 'contacts' directive is likely being inherited from nagiosgraph.

The 'use' directive is still valid and should probably be listed. Not sure about '_guide' and '_priority'. They may be still valid for backwards compatibility but being phased out with new directives. I'll look into this a bit more and get back to you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service definition issue

Post by cdienger »

'_guide' and '_priority' are custom variables. https://assets.nagios.com/downloads/nag ... tvars.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service definition issue

Post by cdienger »

Finally, the use directive is covered in https://assets.nagios.com/downloads/nag ... tance.html. There's a link to it at the top of https://assets.nagios.com/downloads/nag ... tions.html in the 'See Also' section.

I think that covers it. Let me know if you have any questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
as300182
Posts: 36
Joined: Tue May 17, 2016 8:09 am

Re: Service definition issue

Post by as300182 »

Many thanks. That covers all the bases beautifully.

I'm happy for this one to be closed now. Thanks.
Locked