Error: Service has no hosts and/or service_description
Posted: Tue Mar 21, 2017 3:34 pm
I am trying to install nagiosxi 5-4.0.2.el7 in an offline mode using rpm files which I downloaded from the nagios site.
I needed to use the offline mode because I can not get to external websites from our servers.
Eventually I was able to get all the dependencies installed and startup nagoisxi.
Prior to installing xi, I installed nagios core and created numerous configuration files.
I am now in the process of trying to import the flat files into nagios XI.
Originally I tried to install all the configuration files using the cfgprep approach.
I tried to import the files in the recommended order but always ended up with an issue I would not resolve.
I then tried to setback and use a small set of contacts, templates, service and hosts as possible using the import approach.
I placed the single cfg file in the import directory, deleted prior files, wrote new ones and selected verify.
I could not work my way around the "Error: Service has no hosts and/or service_description" in my services file.
I could never get a host_name or hostgroup_name to appear in the file. The entry was always missing.
In looking at the services within the configuration manager, I could see that there was a host name and hostgroup_name assigned to the service.
I tried to add multiple hosts and groups to the service but nothing would ever appear.
I even tried to create a service from scratch and when I regenerated the file, the new service would also be missing the host name.
Finally I tried to revert back to the original configuration by running, scripts/restore_defaults.sh.
Unfortunately I kept getting a "NAGIOSQL LOGIN FAILED" error in the generated nagiosql.login file.
I tried to reset the security credentials and remove the old files in services and hosts, but it did not help.
For some reason the php function get_component_credential, was returning the wrong value.
As of yet, I have not updated the password so I still have the default.
I searched everything in /usr/local and could not find the string nagios was pulling anywhere.
I am not very familiar with php so I could not determine where the function was pulling the password from.
The php include files all still have the initial value.
I was able to force the restore_defaults.sh script to work by hardcoding the password in the file.
I still got the same error that the services did not have a host defined for localhost.
I tried removing the nagioscore, nagiossql and nagiosxi packages and reinstalling them.
I still got the same error that the services did not have a host defined for local host.
So my questions are:
1) Why is host_name and hostgroup_name not appearing in my services files which are being generated by xi?
2) Where is get_component_credential pulling the password from because its not what I expect?
I needed to use the offline mode because I can not get to external websites from our servers.
Eventually I was able to get all the dependencies installed and startup nagoisxi.
Prior to installing xi, I installed nagios core and created numerous configuration files.
I am now in the process of trying to import the flat files into nagios XI.
Originally I tried to install all the configuration files using the cfgprep approach.
I tried to import the files in the recommended order but always ended up with an issue I would not resolve.
I then tried to setback and use a small set of contacts, templates, service and hosts as possible using the import approach.
I placed the single cfg file in the import directory, deleted prior files, wrote new ones and selected verify.
I could not work my way around the "Error: Service has no hosts and/or service_description" in my services file.
I could never get a host_name or hostgroup_name to appear in the file. The entry was always missing.
In looking at the services within the configuration manager, I could see that there was a host name and hostgroup_name assigned to the service.
I tried to add multiple hosts and groups to the service but nothing would ever appear.
I even tried to create a service from scratch and when I regenerated the file, the new service would also be missing the host name.
Finally I tried to revert back to the original configuration by running, scripts/restore_defaults.sh.
Unfortunately I kept getting a "NAGIOSQL LOGIN FAILED" error in the generated nagiosql.login file.
I tried to reset the security credentials and remove the old files in services and hosts, but it did not help.
For some reason the php function get_component_credential, was returning the wrong value.
As of yet, I have not updated the password so I still have the default.
I searched everything in /usr/local and could not find the string nagios was pulling anywhere.
I am not very familiar with php so I could not determine where the function was pulling the password from.
The php include files all still have the initial value.
I was able to force the restore_defaults.sh script to work by hardcoding the password in the file.
I still got the same error that the services did not have a host defined for localhost.
I tried removing the nagioscore, nagiossql and nagiosxi packages and reinstalling them.
I still got the same error that the services did not have a host defined for local host.
So my questions are:
1) Why is host_name and hostgroup_name not appearing in my services files which are being generated by xi?
2) Where is get_component_credential pulling the password from because its not what I expect?