Error: There are no services defined!

Posted on 2006-05-05
Last Modified: 2008-01-09
I install and configured nagios and everything I try to start it I receive this error message.

[root@localhost etc]# nagios -v nagios.cfg

Nagios 1.2
Copyright (c) 1999-2004 Ethan Galstad (
Last Modified: 02-02-2004
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 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 host group escalations...
        Checked 0 host group 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 for circular paths between hosts...
Checking for circular service execution dependencies...
Checking global event handlers...
Checking obsessive compulsive service processor command...
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 on the main and host config files, as well as the
     'Whats New' section to find out what has changed.

[root@localhost etc]#
Question by:pdiblasi
    LVL 22

    Accepted Solution

    You haven't set up any services yet.

    The easiest way is to do that through the web interface:

    Once that's done, then everything is reasonably intuitive!

    LVL 22

    Expert Comment

    Worth noting that the directory for nagios web interface may be /usr/share/nagios rather than /usr/local/nagios

    Also it may be that your rpm has automatically installed the nagios web interface - for mine - 1.4:

    Other 'tweaks' that I needed to carry out to get the web interface running:

    1. chown -R apache.apache /usr/share/nagios to give the web server permission to access a few things.
    2. mdified the /etc/httpd/conf.d/nagios.conf to add my ip to the list of ips allowed to access the interface as (or localhost was the only ip allowed in the default configuration.

    LVL 22

    Expert Comment


    1. chown -R apache.apache /usr/lib/nagios/cgi to give the web server permission to access a few things.
    2. *temporaritly* change the use_authentication setting to 0. This *DISABLES* authentication whilst you are sorting out the configuration.

    Once that has been done, you can click on the View Configuration (after selecting the area you want info from) on the left hand side and see what has been selected from a configuration perspective.

    In your case your /etc/nagios/hosts.cfg is either empty or does not exist. Same applies for:


    Again - all in the /etc/nagios directory.

    Minimal hosts.cfg:

    # 'printer1' host definition
    define host{
            use                     generic-host            ; Name of host template to use

            host_name               printer1
            alias                   Printer #1
            check_command           check-host-alive
            max_check_attempts      10
            notification_interval   480
            notification_period     workhours

    Minimal contact.cfg:
    # 'nagios' contact definition
    define contact{
            contact_name                    nagios
            alias                           Nagios Admin
            service_notification_period     24x7
            host_notification_period        24x7
            service_notification_options    w,u,c,r
            host_notification_options       d,u,r
            service_notification_commands   notify-by-email,notify-by-epager
            host_notification_commands      host-notify-by-email,host-notify-by-epager
            email                           nagios-admin@localhost.localdomain
            pager                           pagenagios-admin@localhost.localdomain

    Minimal services.cfg:
    # Generic service definition template
    define service{
            name                            generic-service ; The 'name' of this service template, referenced in other service definitions
            active_checks_enabled           1       ; Active service checks are enabled
            passive_checks_enabled          1       ; Passive service checks are enabled/accepted
            parallelize_check               1       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
            obsess_over_service             1       ; We should obsess over this service (if necessary)
            check_freshness                 0       ; Default is to NOT check service 'freshness'
            notifications_enabled           1       ; Service notifications are enabled
            event_handler_enabled           1       ; Service event handler is enabled
            flap_detection_enabled          1       ; Flap detection is enabled
            process_perf_data               1       ; Process performance data
            retain_status_information       1       ; Retain status information across program restarts
            retain_nonstatus_information    1       ; Retain non-status information across program restarts

            register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!

    Minimal contactgroups.cfg:
    # 'novell-admins' contact group definition
    define contactgroup{
            contactgroup_name       novell-admins
            alias                   Novell Administrators
            members                 nagios

    Minimal hostgroups.cfg:
    # 'novell-servers' host group definition
    define hostgroup{
            hostgroup_name  novell-servers
            alias           Novell Servers
            contact_groups  novell-admins
            members         novell1,novell2

    You could try creating these files and sticking in the above minimal files in an effort to get nagios to start, but I suspect that you might be better off carrying out a complete reinstall?

    LVL 1

    Expert Comment

    Hi Venabili,

    I am still getting the same error.
    1. There are no services defined
    2. there are no hosts defined
    3. checked 0 hosts group
    4. check 0 service group

    all other are fine detecting as 1 contact group checked.

    Please help in this early. Please email the solution to

    Thanks in advance.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now