Announcement

Collapse
No announcement yet.

cfg import

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cfg import

    After importing all cfg files in the following order:

    checkcommands.cfg (as check command)
    miscommand.cfg (as notification command)
    contacts.cfg
    contactgroups.cfg
    timeperiods.cfg
    hosts.cfg
    hostgroups.cfg
    services.cfg
    servicegroups.cfg
    dependencies.cfg

    I get the following output upon pressing EXPORT

    Code:
    Nagios 2.4
    Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org)
    Last Modified: 05-31-2006
    License: GPL
    
    Reading configuration data...
    
    Running pre-flight check on configuration data...
    
    Checking services...
    Error: There are no services defined!
    Checked 0 services.
    Checking hosts...
    Error: There are no hosts defined!
    Checked 0 hosts.
    Checking host groups...
    Error: There are no host groups defined!
    Checked 0 host groups.
    Checking service groups...
    Checked 0 service groups.
    Checking contacts...
    Error: There are no contacts defined!
    Checked 0 contacts.
    Checking contact groups...
    Error: There are no contact groups defined!
    Checked 0 contact groups.
    Checking service escalations...
    Checked 0 service escalations.
    Checking service dependencies...
    Checked 0 service dependencies.
    Checking host escalations...
    Checked 0 host escalations.
    Checking host dependencies...
    Checked 0 host dependencies.
    Checking commands...
    Checked 0 commands.
    Checking time periods...
    Checked 0 time periods.
    Checking extended host info definitions...
    Checked 0 extended host info definitions.
    Checking extended service info definitions...
    Checked 0 extended service info definitions.
    Checking for circular paths between hosts...
    Checking for circular host and service dependencies...
    Checking global event handlers...
    Checking obsessive compulsive processor commands...
    Checking misc settings...
    Warning: Nothing specified for illegal_macro_output_chars variable!
    
    Total Warnings: 1
    Total Errors: 5
    
    ***> One or more problems was encountered while running the pre-flight check...
    
    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.
    What am I doing wrong? Will Oreon with with nagios 2.x config files?

    Thanks in advance
    -_-_-_-_-_-_-_-_-_-_-_-_-
    Mike Methe
    http://blatbox.freehostia.com

  • #2
    I advise you to begin with commands like you did.
    But after, make an archive with the others files, with a blank line at each begin of file. (cause of a php func with trunc the first line.. so it should not be the begin of a definition..)

    Code:
    tar -czf myArchive.tar.gz hosts.cfg services.cfg ...
    Romain Le Merlus
    Centreon Forge
    MERETHIS

    Comment


    • #3
      Originally posted by rom
      I advise you to begin with commands like you did.
      But after, make an archive with the others files, with a blank line at each begin of file. (cause of a php func with trunc the first line.. so it should not be the begin of a definition..)

      Code:
      tar -czf myArchive.tar.gz hosts.cfg services.cfg ...
      Thanks for the quick reply and I am making some progress:

      Code:
      Nagios 2.4
      Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org)
      Last Modified: 05-31-2006
      License: GPL
      
      Reading configuration data...
      
      Error: Service description, host name, or check command is NULL
      Error: Could not register service (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 580)
      
      ***> The name of the main configuration file looks suspicious...
      
      Make sure you are specifying the name of the MAIN configuration file on
      the command line and not the name of another configuration file. The
      main configuration file is typically '/usr/local/nagios/etc/nagios.cfg'
      
      ***> 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.
      I looked at line 580 in the indicated file and it looks the same as all other services above line 580. What would be causing this one?

      Thanks!

      -Mike M
      -_-_-_-_-_-_-_-_-_-_-_-_-
      Mike Methe
      http://blatbox.freehostia.com

      Comment


      • #4
        Can we see this definition and the definition you try to upload before ?
        Romain Le Merlus
        Centreon Forge
        MERETHIS

        Comment


        • #5
          Here is service config'd at line 580:

          Code:
          define service{
                  host_name                               AIRPORT 2950
                  service_description             PING
                  use                             generic-service
                  is_volatile                     0
                  max_check_attempts                      4
                  normal_check_interval           5
                  retry_check_interval            1
                  check_period                    24x7
                  notification_interval           960
                  notification_period             24x7
                  notification_options            w,u,c,r
                  contact_groups                  admins
          }
          Here is a portion above 580:

          Code:
          define service{
                  host_name                               SPAM
                  service_description             PING
                  use                             generic-service
                  is_volatile                     0
                  max_check_attempts                      4
                  normal_check_interval           5
                  retry_check_interval            1
                  check_period                    24x7
                  notification_interval           960
                  notification_period             24x7
                  notification_options            w,u,c,r
                  contact_groups                  admins
          }
          
          define service{
                  host_name                               FIREWALL
                  service_description             PING
                  use                             generic-service
                  is_volatile                     0
                  max_check_attempts                      4
                  normal_check_interval           5
                  retry_check_interval            1
                  check_period                    24x7
                  notification_interval           960
                  notification_period             24x7
                  notification_options            w,u,c,r
                  contact_groups                  admins
          }
          Thanks for looking...

          -Mike M
          -_-_-_-_-_-_-_-_-_-_-_-_-
          Mike Methe
          http://blatbox.freehostia.com

          Comment


          • #6
            There are no check_command define isn't it ?
            Can you check that your generic-service template is well recorded and generated ?
            Romain Le Merlus
            Centreon Forge
            MERETHIS

            Comment


            • #7
              If I look in 'Check Command' There is nothing there! Why would these not be there?

              -Mike M
              -_-_-_-_-_-_-_-_-_-_-_-_-
              Mike Methe
              http://blatbox.freehostia.com

              Comment


              • #8
                Bad upload... Clean the past elements wich have been bap upload by deleting them and :

                -Upload checkcommand, and see in configuration=>nagios=>check command if they are there.

                -Upload misccommand, and see in configuration=>contact=>notif command if they are there.

                -Do the last proc I wrote you with the tar.gz archive for the other files.
                Romain Le Merlus
                Centreon Forge
                MERETHIS

                Comment


                • #9
                  Originally posted by rom
                  There are no check_command define isn't it ?
                  Can you check that your generic-service template is well recorded and generated ?
                  There is not a generic-service template.

                  -Mike M
                  -_-_-_-_-_-_-_-_-_-_-_-_-
                  Mike Methe
                  http://blatbox.freehostia.com

                  Comment


                  • #10
                    Do you make what I told you about upload again ? Nothing new ??

                    Can I see you command file (PM) ? It seems strange that the problem came from it.
                    Generally, the configuration not generate from Oreon can have little mistake when they are upload (and we change the regexp ), but it never happen from the command...
                    Romain Le Merlus
                    Centreon Forge
                    MERETHIS

                    Comment


                    • #11
                      Post your generic-service definition template too
                      Romain Le Merlus
                      Centreon Forge
                      MERETHIS

                      Comment


                      • #12
                        Originally posted by rom
                        Do you make what I told you about upload again ? Nothing new ??

                        Can I see you command file (PM) ? It seems strange that the problem came from it.
                        Generally, the configuration not generate from Oreon can have little mistake when they are upload (and we change the regexp ), but it never happen from the command...
                        I'm sorry but I am not sure what file you are asking to see... checkcommands.cfg?
                        -_-_-_-_-_-_-_-_-_-_-_-_-
                        Mike Methe
                        http://blatbox.freehostia.com

                        Comment


                        • #13
                          Not sure how but I got a clean report with 0 errors!

                          What now? Should I see some activity in the monitoring screen?

                          Thanks for ALL the help!

                          -Mike M
                          -_-_-_-_-_-_-_-_-_-_-_-_-
                          Mike Methe
                          http://blatbox.freehostia.com

                          Comment


                          • #14
                            Yes, if you well fill your nagios.cfg conf and the general options, you should see something :roll:
                            Romain Le Merlus
                            Centreon Forge
                            MERETHIS

                            Comment

                            Working...
                            X