Problem with new host defination

J. Bakshi joydeep at infoservices.in
Mon Sep 1 09:49:00 CEST 2008


Good morning,

Hope everyone is well.

I am now working to configure my nagios to monitor my remote servers.

To monitor one of the remote servers I have made a file called
"hosteurope.cfg"
A simple configuration with out and serveice. Just to check coonectivity

###############################################################################
###############################################################################
#
# TIME PERIODS
#
###############################################################################
###############################################################################

# This defines a timeperiod where all times are valid for checks,
# notifications, etc.  The classic "24x7" support nightmare. :-)

define timeperiod{
        timeperiod_name 24x7
        alias           24 Hours A Day, 7 Days A Week
        sunday          00:00-24:00
        monday          00:00-24:00
        tuesday         00:00-24:00
        wednesday       00:00-24:00
        thursday        00:00-24:00
        friday          00:00-24:00
        saturday        00:00-24:00
        }
# 'workhours' timeperiod definition
define timeperiod{
   timeperiod_name   workhours
   alias    "Normal" Working Hours
   monday      09:30-18:00
   tuesday     09:30-18:00
   wednesday   09:30-18:00
   thursday 09:30-18:00
   friday      09:30-18:00
   }


# 'nonworkhours' timeperiod definition
define timeperiod{
   timeperiod_name   nonworkhours
   alias    Non-Work Hours
   sunday      00:00-24:00
   monday      00:00-09:30,18:00-24:00
   tuesday     00:00-09:30,18:00-24:00
   wednesday   00:00-09:30,18:00-24:00
   thursday 00:00-09:30,18:00-24:00
   friday      00:00-09:30,18:00-24:00
   saturday 00:00-24:00
   }


# 'none' timeperiod definition
define timeperiod{
   timeperiod_name   none
   alias    No Time Is A Good Time
   }
###############################################################################
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################

# In this simple config file, a single contact will receive all alerts.
# This assumes that you have an account (or email alias) called
# "nagios-admin" on the local host.

define contact{
        contact_name                    nagios-admin
        alias                           Nagios Admin
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           joydeep at infoservices.in
        }


###############################################################################
###############################################################################
#
# HOSTS
#
###############################################################################
###############################################################################

# Generic host definition template - This is NOT a real host, just a
template!

define host{
        name                            generic-host    ; The name of
this host template
        notifications_enabled           1          ; Host notifications
are enabled
        event_handler_enabled           1          ; Host event handler
is enabled
        flap_detection_enabled          1          ; Flap detection is
enabled
        failure_prediction_enabled      1          ; Failure prediction
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
       notification_period     24x7     ; Send host notifications at any
time
        register                        0          ; DONT REGISTER THIS
DEFINITION - ITS NOT A REAL HOST, JUS>
        }

define host{
          name                  remoteserver             ; Name of this
template
          use                   generic-host          ; Inherit default
values
          check_period          24x7
          check_interval        5
          retry_interval        1
          max_check_attempts    10
          check_command         check-host-alive
          notification_period   24x7
          notification_interval 30
          notification_options  d,r
          contact_groups        admins
          register              0          ; DONT REGISTER THIS - ITS A
TEMPLATE
          }


define host{
          use       remoteserver     ; Inherit default values from a
template
          host_name hosteurope_server    ; The name we're giving to this
server
          alias     SuSe 9.3 ; A longer name for the server
          address    87.290.19.289  ; IP address of the server
          }

Then I define the cfg file in nagios.cfg like this
===================================
# Host and service definitions for monitoring this machine
cfg_file=/etc/nagios/localhost.cfg

# Host and service definitions for monitoring hosteurope
cfg_file=/etc/nagios/hosteurope.cfg
===================================

finally when I reload nagios it throws an error like
Running configuration check... FAILED!  Reload aborted.  Check your
Nagios configuration.

Could any one tell me my mistake ?
thanks

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joydeep Bakshi, Linux System Admin
Kolkatainfoservices Pvt Ltd,
23A Royd Street, Kolkata 700016, India
Work Phone 91 033 40014784
http://infoservices.in/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list