Error in writing database configs to file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
msyed
Posts: 5
Joined: Mon Jun 27, 2016 5:43 pm

Error in writing database configs to file

Post by msyed »

Hi Nagios Support,
I am trying the NagiosXi for the first time and importing our configs over from our existing Nagios Core to Xi. I created some config files and followed instructions to import them using the prep tool.
I am getting the following error in the GUI as shown in the attached snapshot.

This happens when I try to do this:
[root@nagiosxi1-eq etc]# pwd
/usr/local/nagios/etc
[root@nagiosxi1-eq etc]# grep -r nagioswrk1-eq *

I can't find the nagioswrk1-eq host. I am guessing the error is coming from the database somewhere.

How can I fix this in the future. There are a lot of config files I need to import and most of them have custom scripts.

Please advice.

Thanks

# mukarram

Code: Select all

[root@nagiosxi1-eq etc]# tree cfgprep/
cfgprep/
├── 8x8-linux-hostgroups.cfg
├── 8x8-linux-hosts.cfg
├── 8x8-linux-services.cfg
├── _empty_host.cfg
├── _multiple_hosts.cfg
├── netmon1-uk.cfg
├── netmon1-uk-hostgroups.cfg
├── netmon1-uk-hosts.cfg
├── netmon1-uk-services.cfg
└── orig
    ├── 8x8-linux-hostgroups.cfg
    ├── 8x8-linux-hosts.cfg
    ├── 8x8-linux-services.cfg
    ├── netmon1-uk-hostgroups.cfg
    ├── netmon1-uk-hosts.cfg
    └── netmon1-uk-services.cfg

1 directory, 15 files

[root@nagiosxi1-eq cfgprep]# cat orig/8x8-linux-hosts.cfg 
########################
##  8x8-HOSTS.CFG  ##
########################

##################
# HOSTS TEMPLATE #
##################

define host{
        name                            8x8-host
        alias                           8x8-hosts
        check_command                   check_ping
        max_check_attempts              1
        contact_groups                  sys-ops
        notification_options            d,u,r
        notification_period             24x7
        notification_interval           5
        notifications_enabled           1
        event_handler_enabled           1
        flap_detection_enabled          1
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        register                        0
}


define host{
        host_name                       nagios-wkr-eq
        address                         192.168.131.95
        use                             8x8-host
}

# EOF
[root@nagiosxi1-eq cfgprep]# cat orig/8x8-linux-hostgroups.cfg 
############################
## 8x8-HOSTGROUPS.CFG  ##
############################

define hostgroup {
        hostgroup_name  8x8-linux
        alias           8x8 servers @ SV2
        members         nagios-wkr-eq
}

#EOF
[root@nagiosxi1-eq cfgprep]# cat orig/8x8-linux-services.cfg 
###########################
##  UK1-SERVICES.CFG  ##
###########################

######################
# SERVICE DEFINITION #
######################

define service{
        name                            8x8-svc
        active_checks_enabled           1
        check_period                    24x7
        normal_check_interval           5
        retry_check_interval            5
        max_check_attempts              2
        contact_groups                  sys-ops
        notification_options            w,u,c,r
        notification_period             24x7
        notification_interval           1440
        notifications_enabled           1
        check_freshness                 7
        is_volatile                     0
        event_handler_enabled           1
        flap_detection_enabled          1
        obsess_over_service             1
        parallelize_check               1
        passive_checks_enabled          1
        process_perf_data               1
        retain_nonstatus_information    1
        retain_status_information       1
        register                        0
}

##############
# CHECK PING #
##############

define service{
        service_description             Check Ping
        check_command                   check_ping
        hostgroup_name                  8x8-linux
        use                             8x8-svc
        contact_groups                  sys-ops
}

################
# MEMORY CHECK #
################

define service{
        service_description             Check mem
        check_command                   check_nrpe!check_mem_linux
	_joomlaurl			http://betazoid.8x8.com/alarms/350-check-mem-alarms
        hostgroup_name                  8x8-linux
        use                             8x8-svc
        contact_groups                  sys-ops
}

####################
# CHECK DISK USAGE #
####################

define service{
        service_description             Check disk
        check_command                   check_nrpe!check_disk
	_joomlaurl			http://betazoid.8x8.com/alarms/377-problem-disk-space
        hostgroup_name                  8x8-linux
        use                             8x8-svc
        contact_groups                  sys-ops
}


###############
# CHECK LOAD  #
###############

define service{
        service_description             Check load
        check_command                   check_nrpe!check_load
	_joomlaurl			http://betazoid.8x8.com/alarms/419-nagios-check-load
        hostgroup_name                  8x8-linux
        use                             8x8-svc
        contact_groups                  sys-ops
}

##############
# CHECK NTP  #
##############

define service{
        service_description             NTP
        check_command                   check_nrpe!check_ntp
	_joomlaurl			http://betazoid.8x8.com/alarms/328-ntp
        hostgroup_name                  8x8-linux
        use                             8x8-svc
        contact_groups                  sys-ops
}

####
# CHECK TURN
####
##define service{
##        service_description             TURN
##        check_command                   check_turn
##        _joomlaurl                      http://betazoid.8x8.com/alarms/371-taking-turn-servers-out-of-rotation
##        host_name                       8x81-uk
##        use                             8x8-svc
##        max_check_attempts              1
##}

# EOF
You do not have the required permissions to view the files attached to this post.
Last edited by tmcdonald on Tue Jul 05, 2016 10:00 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Error in writing database configs to file

Post by ssax »

Hi, when you I see that you're on the page that you can delete/write/verify your configs.

When you apply config and it fails it automatically reverts the files to a last known good state.

Please click the Delete button and then the Write button and then go look for that config file and see what it says.

When you say custom scripts do you mean custom plugins that they are using?

We'll continue from there.

Thank you
msyed
Posts: 5
Joined: Mon Jun 27, 2016 5:43 pm

Re: Error in writing database configs to file

Post by msyed »

Hi
I have delete, write and verify. But same error.
Snapshots attached.
Please advice.

Thanks

# mukarram
You do not have the required permissions to view the files attached to this post.
msyed
Posts: 5
Joined: Mon Jun 27, 2016 5:43 pm

Re: Error in writing database configs to file

Post by msyed »

Here is the:

[root@nagiosxi1-eq etc]# cat /usr/local/nagios/etc/hosts/nagioswkr1-eq.cfg
###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2016-06-30 18:31:56
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
host_name nagioswkr1-eq
alias Nagios Worker 1
display_name nagioswkr1-eq
address 192.168.131.95
hostgroups linux-servers
check_command check_ping!100.0,20%!500.0,60%!!!!!!
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
msyed
Posts: 5
Joined: Mon Jun 27, 2016 5:43 pm

Re: Error in writing database configs to file

Post by msyed »

Looks like the max_check_attempts error in misleading. There is no line that matches that error in the config file.
# mukarram
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Error in writing database configs to file

Post by ssax »

It is giving the error because you DON'T have them defined, please see this page:

https://assets.nagios.com/downloads/nag ... .html#host

The red ones are required to be defined on the host (or applied with a template) in order for the config to be valid.

Let me know if you have any questions.
msyed
Posts: 5
Joined: Mon Jun 27, 2016 5:43 pm

Re: Error in writing database configs to file

Post by msyed »

Hi Sax,
Can you call me and get on a Webex or Teamviewer session to view my configs. please.
408-775-7419

Thanks

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

Re: Error in writing database configs to file

Post by rkennedy »

ssax wrote:It is giving the error because you DON'T have them defined, please see this page:

https://assets.nagios.com/downloads/nag ... .html#host

The red ones are required to be defined on the host (or applied with a template) in order for the config to be valid.

Let me know if you have any questions.
Please look at the information Sean posted above as this will help to resolve the issue. If you'd like to request a remote session or a phone call, please contact [email protected] to learn about our support options we offer.
Former Nagios Employee
Locked