Page 2 of 3

Re: import of service dependencies

Posted: Thu Feb 20, 2014 2:49 am
by ktservices
i googled my problem and found a similar issue here:
http://www.nagiosql.org/forum8/german-f ... ncies.html
It's a post in german forum, maybe you can use a translator to understand. the post describes a very similar problem and the problem seems not be solved, because of "servicedependencies are considered to be not as important". the post is more than 3 years old, i dont know if the problem is fixed in the current version of nagiosql and what version of nagiosql is used in Nagios XI. could this be the fault?

one of the first replies on my post was you can not recreated the error. did you test to import servicedependencies to a newly created host with services, already available with the same name at an existing host?

Re: import of service dependencies

Posted: Thu Feb 20, 2014 1:57 pm
by lmiltchev
OK, here's how I tested the import of service dependencies - let me know if I misunderstood the scenario:

1. I have a host, named "Windows7" with bunch of services, already created and I don't have any service dependencies defined at the moment.
example1.PNG
example2.PNG
2. I placed my config ("test.cfg") in the "/usr/local/nagiosxi/tools/xiprepimport.php orig/" directory, ran the "xiprepimport.php" tool, and imported the newly created "test.cfg" in the "/usr/local/nagios/etc/cfgprep/" directory via the web interface.

Code: Select all

[root@testbox cfgprep]# pwd
/usr/local/nagios/etc/cfgprep
[root@testbox cfgprep]# ll ./orig
total 4
-rw-r--r-- 1 root root 761 Feb 20 12:31 test.cfg
[root@testbox cfgprep]# php /usr/local/nagiosxi/tools/xiprepimport.php orig/test.cfg
[root@testbox cfgprep]# ll
total 8
drwxrwsr-x 2 apache nagios 4096 Feb 20 12:31 orig
-rw-r--r-- 1 root   nagios  702 Feb 20 12:38 test.cfg

Code: Select all

define servicedependency {
       dependent_host_name           		Windows7
       dependent_service_description 		AMD External Events Utility,Avg. Disk Bytes/Read,Avg. Disk sec/Read,Bytes Total per second,Check Connections,CPU Usage,Disk Read Time,Disk Writes per sec,Drive C: Disk Usage,Drive D: Disk Usage,Encrypting File System _EFS_, 	
Explorer,License Status,Logon Errors,Memory Usage,Mount Point,Page File Usage,Physical Memory,Server Work Queues,Split IO/Sec,Total Processes,Uptime
       host_name                     		Windows7
       service_description           		Ping
       inherits_parent               		1
       execution_failure_criteria    		w,u,c,
       notification_failure_criteria 		w,u,c,
       dependency_period             		24x7

}
example3.PNG
I applied configuration, and went to see if the new service dependency was indeed imported properly.
example4.PNG
example5.PNG

Re: import of service dependencies

Posted: Fri Feb 21, 2014 2:50 am
by ktservices
thanks for the detailed explanation. ;)
is the host "windows7" the only host in your nagios xi?
i did also have no problems with the first host on my nagios xi. the problem comes with the second host with the same services and the same servicedependencies.

Re: import of service dependencies

Posted: Fri Feb 21, 2014 2:35 pm
by lmiltchev
No, this is not the only host I have on my test box. However, I don't have another host with the same services. Anyway, I am going to clone this host, along with its services, and will try to import another file with the same service dependencies. Most probably I will get back to you on Monday, since today we are working remotely due to a snow storm.

Re: import of service dependencies

Posted: Tue Mar 11, 2014 3:26 am
by ktservices
could you already perform the test with an other maschine on your testsystem?

Re: import of service dependencies

Posted: Tue Mar 11, 2014 12:39 pm
by scottwilkerson
ktservices wrote:i did a simple test on my testserver. It's VM on KVM with a rather fresh installation of nagios xi and only a vew hosts with a few checks.
I added to the existing host a new check. The new check has the same name as another check on an other host already has.
i created manually a file with the following content under this directory "/usr/loca/nagios/etc/nagioscore_mig":

define servicedependency{
host_name localhost
service_description PING
dependent_host_name localhost
dependent_service_description Apache-Webserver
execution_failure_criteria w,u,c
notification_failure_criteria w,u,c
}

Then i imported this file as described in this document http://assets.nagios.com/downloads/nagi ... nto_XI.pdf:
- importing the file >> OK
- writing and verifing the config files >> OK
- apply configuration >> OK

then i took a look at legacy ccm and found a new servicedependency for "localhost" and under "Dependent Services" is "Apache-Webserver" is written. But when i open the servicedependency is "Dependent Services" empty. It seems, only parts of the servicedependency are imported and the configuration is not completed. Both of my Nagios-XI Servers do the same, even the rather new installed Testserver with the newest avaialable Version of Nagios XI 2012 R2.9.
What is the error?
Are you sure the PING service exists for localhost? (it is case sensitive)

Re: import of service dependencies

Posted: Wed Mar 12, 2014 4:49 am
by ktservices
yes, service "PING" exists for localhost (all letters in uppercase)

Re: import of service dependencies

Posted: Wed Mar 12, 2014 4:56 pm
by slansing
We're testing a few things on this subject, we will get in touch with you tonight or tomorrow on our findings. Could you possibly provide us with the script you are using to generate these files?

Re: import of service dependencies

Posted: Fri Mar 14, 2014 3:59 am
by ktservices
the script which generates these files do some special things for us, for example the server names changes and the script corrects them and so on. but you can see the script generates a correct result.
Mr. Miltchev would do a further test with a cloned machine and then import servicedependencies. What is the result of the test? Could you reconstruct our problem?

Re: import of service dependencies

Posted: Fri Mar 14, 2014 2:16 pm
by lmiltchev
I was able to recreate the issue. It's really weird... my test file got imported just fine and the service dependencies were all written to the config, however the "dependent_service_description" definition was missing from the CCM (and Legacy CCM)... After adding the service via the CCM/Legacy, the "missing" service was added to the database.
I will be filing an internal bug report on the issue. Feel welcome to add anything, or provide some extra info. If you post a bug report on our public tracker (http://tracker.nagios.com), I will link it to our internal bug report.