Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to setup nagios for a host what has the following webroot: www.example.com/ui/html/, but nagios won't accept as host this kind of host path check_ping: Invalid hostname/address.

Is there a workaround for this issue?

# Define a host for the local machine
define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               example.com/ui/html
        alias                   example.com/ui/html
        address                 www.example.com/ui/html/
        }
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
        use                             generic-service
        name                            http-service
        service_description             HTTP
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        notifications_enabled           1
        notification_interval           0
        notification_period             24x7
        notification_options            c,r
        check_command                   check_http!$HOSTADDRESS$
        register 0
     }

Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Are you sure check_ping is what you're suppose to use? The check_ping command just validates the availability of a system via an ICMP ping packet. See this page for details on it's usage: http://nagiosplugins.org/man/check_ping

Instead, I believe you'll need to use the check_http command to verify the web server is responding. Here is a link to it's usage: http://nagiosplugins.org/man/check_http

From the recently added config file, you have this:

define host{
        use                     linux-server
        host_name               example.com/ui/html
        alias                   example.com/ui/html
        address                 www.example.com/ui/html/
        }

The address and host_name lines are incorrect.

  • The host_name should be www.example.com, assuming that's the system name you're hoping to monitor.
  • The address should be the IP address of the same machine, not the name and portion of the URL.

Both of those notes are based on the information in http://nagios.manubulon.com/traduction/docs25en/macros.html

share|improve this answer
    
I have been removing those lines what are referring to check_ping but shows me the same error –  lgt Jun 25 '12 at 14:22
    
thank you for your help –  lgt Jun 25 '12 at 17:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.