NagiosXi not write host_name in service configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SGL
Posts: 2
Joined: Fri Aug 23, 2013 5:15 am

NagiosXi not write host_name in service configuration

Post by SGL »

Hi,

I update mi nagiosxi to de last version.

When I try to modify or add a services the host associated disappear. (with nagiosxi web interface)
Image

if I click the "View config" in nagiosxi:
Image Copiar

But, if i check the checkbox "Exlude" when i add the host to the service, they save good the .cfg (with exlcude host...).
Image Copiar


If in this point I edit the service file .cfg manually and restart nagios they work fine. the problem is when I edit with nagiosXi Interface web (service editor.)

Do you have any idea??

Thanks
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NagiosXi not write host_name in service configuration

Post by rkennedy »

Are you clicking 'Save' after making the changes, followed by 'Apply Configuration' after saving, and then posting the configuration files to look at? It should not let you apply configuration with a host not applied.

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/192.168.47.8.cfg', starting on line 16)
I tried to replicate this on my end, with no luck. It appears to be working over here.
Former Nagios Employee
SGL
Posts: 2
Joined: Fri Aug 23, 2013 5:15 am

Re: NagiosXi not write host_name in service configuration

Post by SGL »

Hi Kennedy, thanks for the reply :)

Yes i do as you say.

The problema is when in nagiosxi i try to edit/add a service. when i sabe the confiiguration the host "disappears" and not write correcly the .cfg.
If I check the exclude options they write correcly.

Maybe is an error do it by the upgrade (some variable or permissions.. I d'ont know).

Maybe it's not important but I find this:
if check this log: tail -f /usr/local/nagiosxi/var/cmdsubsys.lo
i click "Aplly configuration" with services.cfg without host_name defined.

Code: Select all

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/TEST_HOST1.cfg', starting on line 16)
   Error processing object config files!


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

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1476866884.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1476866884.tar.gz
tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/hosts: Cannot change mode to rwsrwsr-x: Operation not permitted
.....
tar: usr/local/nagios/etc/pnp: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: Exiting with failure status due to previous errors
if I edit the -cfg service file manually (I add the host_name) and "Apply configuration" i don't have the error of operation not permitted.

Sorry for the english, it's not the best. If you need some files or some output commands tell me
Thanks!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NagiosXi not write host_name in service configuration

Post by rkennedy »

It sounds like a bug from what you're reporting. Just to make sure I understand though.
The problema is when in nagiosxi i try to edit/add a service. when i sabe the confiiguration the host "disappears" and not write correcly the .cfg.
If I check the exclude options they write correcly.
Are you saving the configuration on the Core Config Manager? It will not write out to the flat files on the system, until AFTER you click apply configuration. To give you a simple overview of what's happening with the CCM -

Code: Select all

1. Data is stored in SQL for all of your hosts / services / contacts / other definitions, etc.
2. CCM modifies data at the SQL layer
3. Clicking 'Apply Configuration' writes out the configuration files BACK to the flat files (/usr/local/nagios/etc/hosts and /usr/local/nagios/etc/services folders)
If you are clicking Apply Configuration, then in the past, I've seen 'ghost' hosts / services appear and the remedy is looking under Configure -> Core Config Manager -> Tools -> Config File Management (Write config files on pre 5.3) -> Then, run a 'delete', 'write', and 'verify'.
Former Nagios Employee
Locked