Service template errors while running XI import procedure

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Service template errors while running XI import procedure

Post by rickwilson7425 »

I am having a problem with several service definitions when trying to import the templates file into XI.

I believe it has to do with the illegal characters in the "action_url" string, particularly the leading ../../

I am not sure what this is trying to do or how to direct the service in XI. Any help would be appreciated.

Here is the definition:

# Generic service definition template 5 minute interval
define service {
name generic-service-5
action_url ../../pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
active_checks_enabled 1
check_freshness 0
check_interval 5
check_period 24x7
event_handler_enabled 1
flap_detection_enabled 1
is_volatile 0
max_check_attempts 3
notes $_SERVICEHTMLOPEN$ Service Priority: $_SERVICEDOC_PRIORITY$ $_SERVICEHTMLBREAK$ Tech Contact: $_SERVICEDOC_TECHCONTACT$ $_SERVICEHTMLCLOSE$
notes_url http://confluence.jeppesen.com/display/TSS/Home
notification_interval 60
notification_options w,u,c,r
notification_period 24x7
notifications_enabled 1
obsess_over_service 1
passive_checks_enabled 1
process_perf_data 1
register 0
retain_nonstatus_information 1
retain_status_information 1
retry_interval 2
_DOC_PRIORITY 5
_DOC_TECHCONTACT Not Identified
_HTMLBREAK <br>
_HTMLCLOSE </p>
_HTMLOPEN <p align=left>
}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Service template errors while running XI import procedur

Post by tmcdonald »

Could you just give it an absolute URL as opposed to the relative? Although that shouldn't really matter as those characters are not illegal. What's the actual problem or error you are experiencing?
Former Nagios employee
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Service template errors while running XI import procedur

Post by rickwilson7425 »

I am getting this error when trying to verify my config in CCM:

*************************************************************************

Error: Template 'generic-service-5' specified in service definition could not be not found (config file '/usr/local/nagios/etc/services/DENALTSMP01P.cfg', starting on line 62)

Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Template 'generic-service-5' specified in service definition could not be not found (config file '/usr/local/nagios/etc/services/DENALTSMP01P.cfg', starting on line 62)
Error processing object config files!


***> One or more problems was encountered while processing the config files...


*************************************************************************

When I go into CCM and open the Service Templates tool I get a message that says there are illegal characters in the definition for the above referenced "generic-service-5". When I remove the leading "../../" in the action-url I don't get that message any more.

I assumed that those illegal characters were the cause of the definition not being written out to the configuration files and that is why I am getting the above error message.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Service template errors while running XI import procedur

Post by abrist »

rickwilson7425 wrote: I assumed that those illegal characters were the cause of the definition not being written out to the configuration files and that is why I am getting the above error message.
You assumed correctly. XI has graphs on the details page under a different tab. Do you need the action url?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Service template errors while running XI import procedur

Post by rickwilson7425 »

I think so. It is used in a whole bunch of server monitors and in 2 other service definitions that I have found so far. The only difference in those is the check times, one is 5 minutes, one is 10 minutes and the other one is 15 minutes.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Service template errors while running XI import procedur

Post by abrist »

You may want to use a full path for the action url. In 2014, the path to the old perfgraphs is:

Code: Select all

/nagiosxi/perfgraphs/?&host=<hostname>&service=<service description>&source=1&view=1&start=&end=&startdate=&enddate=&mode=2
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked