Announcement

Collapse
No announcement yet.

Problem to add or remove new host / services

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

  • Problem to add or remove new host / services

    i import all my hosts and services from nagios (2.10) ... all imports are ok.
    But after migrate from nagios to centreon i can not add more hosts or services, i add hosts and services at configuration panel, but they don't appear at monitoring panel.

    How do i configure new hosts and services to appear at monitoring after create then in configuration panel?

  • #2
    You do restart nagios with the "move export files" on, do you?

    Comment


    • #3
      No, i don't.

      Every time that i add new hosts and services in centreon configuration panel i need to run
      Centreon > Configuration > Nagios > Generate
      to restart nagios and mark move export files?

      i need to run it to get effects every time that i change some configuration?

      Comment


      • #4
        That is correct, as far as I understand.

        Comment


        • #5
          i create a new host, create new services for this host, remove old services from an existent host. But when i try to restart Nagios by centreon i receive the following message at state:

          Code:
          Nagios 2.10
          Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
          Last Modified: 10-21-2007
          License: GPL
          
          Reading configuration data...
          
          Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service '/' on host 'anubis'
          Error: Could not register service (config file '/usr/local/centreon/filesGeneration/nagiosCFG/services.cfg', starting on line 20)
          
          ***> 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.
          
          
          Nagios 2.10
          Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
          Last Modified: 10-21-2007
          License: GPL
          
          Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service '/' on host 'anubis'
          Error: Could not register service (config file '/usr/local/centreon/filesGeneration/nagiosCFG/services.cfg', starting on line 20)
          ***> One or more problems was encountered while reading configuration data...
          
          cgi.cfg - movement OK
          checkcommands.cfg - movement OK
          contactgroups.cfg - movement OK
          contacts.cfg - movement OK
          dependencies.cfg - movement OK
          escalations.cfg - movement OK
          hostextinfo.cfg - movement OK
          hostgroups.cfg - movement OK
          hosts.cfg - movement OK
          meta_commands.cfg - movement OK
          meta_contact.cfg - movement OK
          meta_contactgroup.cfg - movement OK
          meta_dependencies.cfg - movement OK
          meta_escalations.cfg - movement OK
          meta_host.cfg - movement OK
          meta_hostgroup.cfg - movement OK
          meta_services.cfg - movement OK
          meta_timeperiod.cfg - movement OK
          misccommands.cfg - movement OK
          nagios.cfg - movement OK
          perfparse.cfg - movement OK
          resource.cfg - movement OK
          serviceextinfo.cfg - movement OK
          servicegroups.cfg - movement OK
          services.cfg - movement OK
          timeperiods.cfg - movement OK
          
          Generating SNMPTT configuration files...
          4 traps for 1 manufacturers are defined.
          SNMPTT configuration files generated.

          i open my /usr/local/centreon/filesGeneration/nagiosCFG/services.cfg and copy a piece of code for you see that have no errors at point where centreon says that have errors.

          Code:
          define service{
                  host_name                               pinho
                  service_description             PING
                  check_command                   check_ping!1000.0,20%!5000.0,60%!5
                  contact_groups                  linux-admins
          }
          
          define service{
                  host_name                               anubis
                  service_description             PING
                  check_command                   check_ping!1000.0,20%!5000.0,60%!5
                  contact_groups                  linux-admins
          }
          
          define service{
                  host_name                               horus
                  service_description             PING
                  check_command                   check_ping!1000.0,20%!5000.0,60%!5
                  contact_groups                  linux-admins
          }
          
          define service{
                  host_name                               neftis
                  service_description             PING
                  check_command                   check_ping!1000.0,20%!5000.0,60%!5
                  contact_groups                  linux-admins
          }

          but i don't understand when they say:

          Code:
          ***> 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'

          I can access nagios normally by the same web host from centreon.
          centreon: http://servers/centreon/
          nagios: http://servers/nagios


          and after this tryed to restart Nagios by centreon no new servers and hosts appear at monitoring panel.

          Comment


          • #6
            Well, the first part of the error message sounds self-descriptive (invalid max_attempts etc). Are all of those filled in?
            I would bet that the second error message about the bad file name will magically disappear once you solve the first one.

            Comment


            • #7
              i fix the problem reconfiguring all services and setting max_attempts, check_interval, retry_interval and notification_interval for all services.

              after this i receive another problem, that my users doesn't has no service notification commands defined! o no host notification commands defined.


              Code:
              Nagios 2.10
              Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
              Last Modified: 10-21-2007
              License: GPL
              
              Reading configuration data...
              
              Running pre-flight check on configuration data...
              Checked 401 services.
              Checking hosts...
              Checked 39 hosts.
              Checking host groups...
              Checked 5 host groups.
              Checking service groups...
              Checked 0 service groups.
              Checking contacts...
              Error: Contact 'antonio' has no service notification commands defined!
              Error: Contact 'antonio' has no host notification commands defined!
              Warning: Contact 'antonio' has no service notification time period defined!
              Warning: Contact 'antonio' has no host notification time period defined!
              Error: Contact 'fabio' has no service notification commands defined!
              Error: Contact 'fabio' has no host notification commands defined!
              Warning: Contact 'fabio' has no service notification time period defined!
              Warning: Contact 'fabio' has no host notification time period defined!
              Error: Contact 'producao' has no service notification commands defined!
              Error: Contact 'producao' has no host notification commands defined!
              Warning: Contact 'producao' has no service notification time period defined!
              Warning: Contact 'producao' has no host notification time period defined!
              Error: Contact 'renato' has no service notification commands defined!
              Error: Contact 'renato' has no host notification commands defined!
              Warning: Contact 'renato' has no service notification time period defined!
              Warning: Contact 'renato' has no host notification time period defined!
              Checked 4 contacts.
              Checking contact groups...
              Checked 3 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 45 commands.
              Checking time periods...
              Checked 8 time periods.
              Checking extended host info definitions...
              Checked 39 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...
              
              Total Warnings: 28
              Total Errors: 8
              ***> 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.
              
              
              Nagios 2.10
              Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
              Last Modified: 10-21-2007
              License: GPL
              
              cgi.cfg - movement OK
              checkcommands.cfg - movement OK
              contactgroups.cfg - movement OK
              contacts.cfg - movement OK
              dependencies.cfg - movement OK
              escalations.cfg - movement OK
              hostextinfo.cfg - movement OK
              hostgroups.cfg - movement OK
              hosts.cfg - movement OK
              meta_commands.cfg - movement OK
              meta_contact.cfg - movement OK
              meta_contactgroup.cfg - movement OK
              meta_dependencies.cfg - movement OK
              meta_escalations.cfg - movement OK
              meta_host.cfg - movement OK
              meta_hostgroup.cfg - movement OK
              meta_services.cfg - movement OK
              meta_timeperiod.cfg - movement OK
              misccommands.cfg - movement OK
              nagios.cfg - movement OK
              perfparse.cfg - movement OK
              resource.cfg - movement OK
              serviceextinfo.cfg - movement OK
              servicegroups.cfg - movement OK
              services.cfg - movement OK
              timeperiods.cfg - movement OK
              I try to edit users and set informations, but when i try to save i receive the following message on Alias field:
              " that You have to keep at least one contact to access to Centreon "

              i put many informations at this field but i can't fix it.
              someone can help-me?

              Comment


              • #8
                ok, Now i fix all problems, restart nagios by shell and by centreon panel. all hosts appear at monitoring panel.


                Now i need to create graphs and doesn't know how do i do this ... at Centreon views i have no hosts to select.

                Comment


                • #9
                  You can find a tutorial in the Wiki at this url:
                  http://wiki.oreon-project.org/index.php/Graphs

                  I hope it will help you.
                  Guigui

                  > PAS DE SUPPORT VIA MP <

                  "Ce n'est qu'en essayant continuellement que l'on finit par réussir. En d'autres termes, plus ça rate et plus on a de chances que ça marche !!" (Shadoks)

                  Comment


                  • #10
                    but this document says that i need to have perfdata instaled and configured to generate graphs.
                    I don't remember where, but i remember that i read some post saying that Oreon Data Storage(ODS - now CDS) replaces perfdata and that i didn't need perfdada to generate graphs.

                    whats the correct?

                    Comment


                    • #11
                      It's perfparse that you don't need anymore.
                      If I understand correctly nagios picks up performance data, stores them in perfdata file, ods picks them up from there and stores them in *.rrd files.
                      So for graphs you do need perfdata, but not perfparse.

                      The link you will find two posts back will guide you.

                      Comment


                      • #12
                        Ok. thanks for help-me .


                        I'm using Centreon 1.4.2.1.

                        Now i configure part of article.

                        I do the "Perfdata activation in Nagios", and it create a new file /usr/local/nagios/var/service-perfdata with no problem and store data from my check commands, look:
                        Code:
                        [[email protected] var]# cd /usr/local/nagios/var/
                        [[email protected] var]# ls
                        archives      host-perfdata.out  objects.cache  service-perfdata
                        comments.dat  nagios.lock        retention.dat  status.dat
                        downtime.dat  nagios.log         rw             status.dat_light
                        [[email protected] var]# tail -20 service-perfdata 
                        1202469777      ntsrv-bcms      CPULOAD CPU Load 56% (10 min average)   OK
                        [SERVICEPERFDATA]       1202469787      ntsrv-bcms      CPULOAD 0.014   0.268   CPU Load 56% (10 min average)
                        1202469781      osiris  /ERPPRD/ARCHIVE DISK OK [2885950 kB (99%) free on /dev/vg24/lvol2]      OK
                        [SERVICEPERFDATA]       1202469787      osiris  /ERPPRD/ARCHIVE 0.229   0.058   DISK OK [2885950 kB (99%) free on /dev/vg24/lvol2]
                        1202469786      osiris  /ERPPRD/INDEX1  DISK OK [1680096 kB (18%) free on /dev/vg23/lvol1]      OK
                        [SERVICEPERFDATA]       1202469787      osiris  /ERPPRD/INDEX1  0.170   0.117   DISK OK [1680096 kB (18%) free on /dev/vg23/lvol1]
                        1202469790      osiris  /ERPPRD/SYSTEM1 DISK OK [913396 kB (7%) free on /dev/vg20/lvol1]        OK
                        [SERVICEPERFDATA]       1202469797      osiris  /ERPPRD/SYSTEM1 0.176   0.197   DISK OK [913396 kB (7%) free on /dev/vg20/lvol1]
                        1202469795      osiris  /VAR    DISK OK [784488 kB (15%) free on /dev/vg00/lvol8]       OK
                        [SERVICEPERFDATA]       1202469797      osiris  /VAR    0.341   0.009   DISK OK [784488 kB (15%) free on /dev/vg00/lvol8]
                        1202469799      osiris  ERPPRD_APD      prod : APD WARNING  - 95% used [ 34 / 760 MB available ]        WARNING
                        [SERVICEPERFDATA]       1202469807      osiris  ERPPRD_APD      0.576   0.084   prod : APD WARNING  - 95% used [ 34 / 760 MB available ]
                        1202469804      osiris  ERPPRD_CADDS    prod : CADDS WARNING  - 87% used [ 152 / 1200 MB available ]    WARNING
                        [SERVICEPERFDATA]       1202469807      osiris  ERPPRD_CADDS    0.519   0.150   prod : CADDS WARNING  - 87% used [ 152 / 1200 MB available ]
                        1202469808      osiris  ERPPRD_CMBXS    prod : CMBXS OK - 70% used [ 424 / 1450 MB available ]  OK
                        [SERVICEPERFDATA]       1202469817      osiris  ERPPRD_CMBXS    0.487   0.022   prod : CMBXS OK - 70% used [ 424 / 1450 MB available ]
                        1202469871      poseidon        UPTIME  System Uptime : 14 day(s) 21 hour(s) 17 minute(s)       OK
                        [SERVICEPERFDATA]       1202469877      poseidon        UPTIME  0.026   0.162   System Uptime : 14 day(s) 21 hour(s) 17 minute(s)
                        1202469876      seth    /ERPQAS/DATA3   DISK OK - [100104 kB (1%) free on /dev/vg06/lvol11]     OK
                        [SERVICEPERFDATA]       1202469877      seth    /ERPQAS/DATA3   0.243   0.214   DISK OK - [100104 kB (1%) free on /dev/vg06/lvol11]
                        [[email protected] var]#
                        After this i "Configure ODS in order to catch data".
                        Code:
                         Options > Centreon > CentreonDataStorage > Config
                        
                          <> Centreon Informations
                        Path to RRDtool Database			/var/lib/ods/database
                        RRDTool database size				365 days
                        Retention Duration for Data in MySQL		365 days
                        RRDTool auto delete				unmarked
                        Sleep time					10
                        Purge check interval				60
                        Storage Type					RRDTool & MySQL
                        Perfdata					/usr/local/nagios/var/service-perfdata
                        Drop Data in another file			marked
                        Drop file					/usr/local/nagios/var/service-perfdata.tmp
                        
                          <> Logs
                        Archive Nagios Logs				marked
                        Logs retention duration				31 days
                        Nagios current log file to parse		/usr/local/nagios/var/nagios.log
                        
                          <> Monitoring
                        fast status log parsing				unmarked
                        but the article says to Set 'Path to RRDTool Database' to '/usr/local/oreon/OreonDataStorage/' , but i didn't have this directory, i have /usr/local/centreon/ODS, and at 'Path to RRDTool Database' field, i have /var/lib/ods/ by default, but have no data files at this folders.

                        Code:
                        [[email protected] var]# ls /var/lib/ods/database/
                        backup
                        [[email protected] var]# ls /var/lib/ods/database/backup/
                        [[email protected] var]#
                        i change it to '/usr/local/centreon/ODS/var' , but no rrd files are generated at any of this directorys. I have an file "/usr/local/centreon/ODS/var/ods_demon.log" and at this file i have:
                        Code:
                        [[email protected] var]# tail -20 ods_demon.log 
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 455.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 459.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 473.
                        Execution of /usr/local/centreon/ODS/ods aborted due to compilation errors.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 455.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 459.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 473.
                        Execution of /usr/local/centreon/ODS/ods aborted due to compilation errors.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 455.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 459.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 473.
                        Execution of /usr/local/centreon/ODS/ods aborted due to compilation errors.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 455.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 459.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 473.
                        Execution of /usr/local/centreon/ODS/ods aborted due to compilation errors.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 455.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 459.
                        Bareword "RRDs::error" not allowed while "strict subs" in use at /usr/local/centreon/ODS/ods line 473.
                        Execution of /usr/local/centreon/ODS/ods aborted due to compilation errors.
                        [[email protected] var]#

                        In 'Oreon -> Options -> General Options -> RRDTool'

                        1. Check that 'Directory + RRDTOOL Binary' is correct (ex : /usr/bin/rrdtool) OK

                        2. Check that rrdtool version is correct ('rrdtool --version' will provide the answer) OK

                        3. Select 'Simple Graphs Renderer' for Favorite Graphs Engine Fail Where are this field? my centreon don't have this option.

                        In 'Oreon -> Options -> General Options -> Nagios'

                        Check that paths to files are correct (for full ODS, 'Using Perfparse' option is not requested)
                        I didn't understand this option.

                        At "Configuration > Nagios > Nagios CFG" I put:
                        Code:
                        Performance Data Processing Option			Yes
                        Host Performance Data Processing Command		process-host-perfdata	
                        Service Performance Data Processing Command		process-service-perfdata
                        Host Performance Data File				/usr/local/nagios/var/service-perfdata
                        Service Performance Data File				/usr/local/nagios/var/service-perfdata
                        Host Performance Data File Template			<nothing>	
                        Service Performance Data File Template			<nothing>
                        Host Performance Data File Mode	a w Default		<nothing>
                        Service Performance Data File Mode	a w Default	<nothing>
                        Host Performance Data File Processing Interval		<nothing>	
                        Service Performance Data File Processing Interval	<nothing>
                        Host Performance Data File Processing Command		process-host-perfdata
                        Service Performance Data File Processing Command	process-host-perfdata

                        Comment


                        • #13
                          So, Nagios create the service-perfdata file. (in /usr/local/nagios/var/service-perfdata)

                          -> Keep "Path to RRDtool Database" to /var/lib/ods/database for the moment...

                          But ODS not parse the service-perdata file. (in /usr/local/nagios/var/service-perfdata)
                          Is ODS service started ?
                          If not, start it, wait a few minutes and check if rrd files are present in your "RRDtool Database" direcrtory...
                          Guigui

                          > PAS DE SUPPORT VIA MP <

                          "Ce n'est qu'en essayant continuellement que l'on finit par réussir. En d'autres termes, plus ça rate et plus on a de chances que ça marche !!" (Shadoks)

                          Comment


                          • #14
                            You don't have to set any "Performance Data File Processing Command", ODS is the processing command that will process all of your data. But the other problem is that your service-perfdata file does not contain any perfdata, just basic Nagios plugin results. You have to configure your plugin/command to send perfdata after the basic output in the "output | perfdata" format or you won't have any graphs, since they are built from that.

                            Don't forget to also upgrade to Centreon 1.4.2.3 which is a bugfix of 1.4.2.x branch.
                            Système : Debian Etch 4.0r8 / Apache 2.2.3 / PHP 5.2.0 / MySQL 5.0.32
                            Monitoring : Nagios 2.12 / Plugins 1.4.13 / Centreon 1.4.2.7

                            Comment


                            • #15
                              Originally posted by Guigui2607 View Post
                              So, Nagios create the service-perfdata file. (in /usr/local/nagios/var/service-perfdata)

                              -> Keep "Path to RRDtool Database" to /var/lib/ods/database for the moment...

                              But ODS not parse the service-perdata file. (in /usr/local/nagios/var/service-perfdata)
                              Is ODS service started ?
                              If not, start it, wait a few minutes and check if rrd files are present in your "RRDtool Database" direcrtory...
                              Ok, i set path to rrdtool database to /var/lib/ods/database.
                              yeap, ODS is started ok
                              Code:
                              [[email protected] ods]# service ods status
                                PID TTY          TIME CMD
                              32579 pts/1    00:00:00 ods
                              [[email protected] ods]#
                              but have no rrd files.

                              Originally posted by -Archi- View Post
                              You don't have to set any "Performance Data File Processing Command", ODS is the processing command that will process all of your data. But the other problem is that your service-perfdata file does not contain any perfdata, just basic Nagios plugin results. You have to configure your plugin/command to send perfdata after the basic output in the "output | perfdata" format or you won't have any graphs, since they are built from that.

                              Don't forget to also upgrade to Centreon 1.4.2.3 which is a bugfix of 1.4.2.x branch.
                              Ok, i upgrade my centreon to 1.4.2.3 without problems. But i didn't understand your parse from my problem. Where i need to change to ods get data from perfdata?

                              my perfdata are writing ok on /usr/local/nagios/var/service-perfdata.

                              what i need to change at "Configuration > Nagios > Nagios CFG" ???

                              I have this fields:
                              Code:
                              Performance Data Processing Option			Yes
                              Host Performance Data Processing Command		process-host-perfdata	
                              Service Performance Data Processing Command		process-service-perfdata
                              Host Performance Data File				/usr/local/nagios/var/service-perfdata
                              Service Performance Data File				/usr/local/nagios/var/service-perfdata
                              Host Performance Data File Template			<nothing>	
                              Service Performance Data File Template			<nothing>
                              Host Performance Data File Mode	a w Default		<nothing>
                              Service Performance Data File Mode	a w Default	<nothing>
                              Host Performance Data File Processing Interval		<nothing>	
                              Service Performance Data File Processing Interval	<nothing>
                              Host Performance Data File Processing Command		process-host-perfdata
                              Service Performance Data File Processing Command	process-host-perfdata
                              thanks for attemptions

                              Comment

                              Working...
                              X