Problem to import service dependencies

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
123456
Posts: 7
Joined: Thu Oct 19, 2017 8:30 am

Problem to import service dependencies

Post by 123456 »

I have a problem to import service dependencies (cfg files) into Nagios XI 5.4.x via WebGUI if no hostname is set in a cfg file. Instead of a hostname I would need to use hostgroup_name only - e.g.:

Code: Select all

define servicedependency {
    dependent_service_description 	A Server
    hostgroup_name 			servers-CIM
    service_description 		CIM Identify
    execution_failure_criteria 	w,u,c
    notification_failure_criteria 	w,u,c
    inherits_parent			1
}
The above values are posible to enter via WebGUI manually w/o any problems.

Tested versions of Nagios XI 5.4.0 - 5.4.10 and I have the problem with all of them (I didn't test older versions of Nagios XI).
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Problem to import service dependencies

Post by npolovenko »

@123456, Could you send in your Nagios XI System Profile so I can review it?
To send us your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it here or send it to me in PM.
*If you choose to send it in pm please let us know here as well as soon as you send it.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
123456
Posts: 7
Joined: Thu Oct 19, 2017 8:30 am

Re: Problem to import service dependencies

Post by 123456 »

The required system profile is attached.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem to import service dependencies

Post by scottwilkerson »

123456 wrote:The above values are posible to enter via WebGUI manually w/o any problems.

Tested versions of Nagios XI 5.4.0 - 5.4.10 and I have the problem with all of them (I didn't test older versions of Nagios XI).
What error are you receiving when you try to import this config?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
123456
Posts: 7
Joined: Thu Oct 19, 2017 8:30 am

Re: Problem to import service dependencies

Post by 123456 »

1) In older versions (e.g. 5.4.8)
Import of a cfg file (CCM -> Tools -> Import Config Files -> e.g. /usr/local/nagios/etc/CIM/servicedependencies/any_service_dependency_file.cfg -> click on the Import button) looked fine, the cfg file seems to be imported but if I clicked on the Apply Configuration button (CCM -> Quick Tools -> Apply Configuration) an error occurred.
To avoid this problem I had to edit each new service dependency manually. It means after clicking on the Import button I had to go to CCM -> Advanced -> Service Dependencies and edit each newly added service dependency ("Manage Host Groups" + "Manage Services" + "Manage Service Dependencies") and then click on the Apply Configuration button. Horrible work but it works.

2) In actual version (5.4.10) the behaviour is a little bit different and for me it is worse.
After clicking on the Import button an error occurs on the web page immediately (CCM -> Tools -> Import Config Files):

The website cannot display the page
HTTP 500
Most likely causes:
•The website is under maintenance.
•The website has a programming error.

But one new service dependency is "imported". That is similar to the older versions - see above. But my some cfg files contain two and more service dependencies and only one of them is "imported" (which must be later edited of course - see above). The rest of service dependencies is not "imported" from the cfg file. Since this version of Nagios XI the import of service dependencies is useless for me.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Problem to import service dependencies

Post by dwhitfield »

123456 wrote:if I clicked on the Apply Configuration button (CCM -> Quick Tools -> Apply Configuration) an error occurred.
What is this error? That may shed some light on the ultimate issue.
123456
Posts: 7
Joined: Thu Oct 19, 2017 8:30 am

Re: Problem to import service dependencies

Post by 123456 »

The error is as expected:

Error: Impossible service dependency definition

because the mandatory values are missing (see - https://assets.nagios.com/downloads/nag ... dependency, the section "Service Dependency Definition"). From my cfg file the items "Manage Host Groups", "Manage Services" and "Manage Service Dependencies" are not imported, see my post above.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Problem to import service dependencies

Post by npolovenko »

@123456, Please take a look at the example below:
In XI this line:

Code: Select all

 #  config_name  service dependency
Needs to present in each service dependency. That's because XI is using GUI interface to manage service dependencies, and it needs to have a different name for each dependency. Don't forget to add a # sign as on the example.

I also haven't found dependent host group or dependent host in your configuration.

Code: Select all

define servicedependency {
  #  config_name  your servicedependency name
    dependent_hostgroup_name      YOUR_DEPENDENT_HOSTGROUP
    dependent_service_description     CIM Identify
    hostgroup_name                           servers-CIM
    service_description               CIM Identify
    inherits_parent                   1
    execution_failure_criteria        w,u,c
    notification_failure_criteria     w,u,c
    dependency_period                 24x7
}
Also, it's very important that each host in both host groups must have dependent service defined.

Code: Select all

dependent_service_description CIM Identify
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
123456
Posts: 7
Joined: Thu Oct 19, 2017 8:30 am

Re: Problem to import service dependencies

Post by 123456 »

The service dependency name was added (#  config_name  my servicedependency name). I have now human readable the service dependency name I do not need to change it manually any more. That's fine.

But the problem which I described in the beginning of this post still persists. But I found out when hostgroup_name (and dependent_hostgroup_name) are before service_description in the cfg file then values of the hostgroup_name (and the dependent_hostgroup_name) are imported but service_description and dependent_service_description are not imported -> error.

For me it is really strange because if I create a service dependency manually (CCM -> Advanced -> Service Dependencies -> Add New -> enter already known values -> Save -> click on the Apply Configuration button) then no error occurs and the new service dependency is created. For sure I can check it (CCM -> Advanced -> Service Dependencies) by clicking on View config button and voilà all wanted values are there. I don't understand this.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Problem to import service dependencies

Post by npolovenko »

Hello, @123456. I tried importing service dependencies with the command that I supplied in my previous post and everything went fine. I did not have http errors and all configs went into place, including service description and dependent service description.
Let's try this. In XI web interface navigate to Configure/Core Configuration Manager.
In the left column click on advanced/Service Dependencies.
Click on add new and let's create our test dependency using web interface(just for troubleshooting).
qwert.png
Select managed host groups, select managed services, select managed dependent host groups, select manage service dependencies.
After that click on save and click on apply configuration. Do you get any errors when you create a new dependency this way?
If no errors view the config:
Un1111titled.png

Code: Select all

Copy it and paste to a new file:
/usr/local/nagios/etc/new_dependency.cfg
Delete allready created dependency from the Service Dependencies menu in XI.(the one that you just created).
Attempt to import newly created dependency using config import tool.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked