Results 1 to 9 of 9

Thread: Nagios

  1. #1
    Join Date
    Dec 2006
    Posts
    288

    Question Nagios

    Using the current version of Nagios, Nagios plugins, and NRPE. Trying to get monitoring of a remote server working. I have other monitoring services functioning, HTTP, POP, FTP, PING. Trying to use check_nrpe.

    Monitoring Server from command line I run:
    /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -n -p 5666 -t 30
    and it returns:
    CHECK_NRPE: Error receiving data from daemon.

    Also I have tested "/usr/local/nagios/libexec/check_nrpe -H localhost" on both Monitoring and Remote server successfully. Then changed the ip in the /etc/xinetd.d/nrpe back and reloaded xinetd.

    On the Remote server, in the messages log I am getting the following:
    Jan 20 22:54:44 XXXX nrpe[8186]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
    Jan 20 22:54:44 XXXX nrpe[8186]: Error: Could not complete SSL handshake. 1

    This is strange because I turned off SSL using the -n option in check_nrpe command.

    I can successfully Telnet into the remote server with "telnet xxx.xxx.xxx.xxx 5666", so I know it is not a firewall issue on the remote server. By the way, both servers have openssl-0.9.7a. What am I missing? Can I compile nrpe with no SSL support, and if so how can that be done?

    Thanks in advance!

  2. #2
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Use the following command.

    Code:
    /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -p 5666 -to 30
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  3. #3
    Join Date
    Dec 2006
    Posts
    288
    Actually I change your command to:
    /usr/local/nagios/libexec/check_nrpe -H 161.58.189.94 -p 5666 -t 30

    and received the following:

    NRPE v2.11

    Looks like we are heading in the right direction.

    Here is what I have in my commands.cfg file for check_nrpe:

    # 'check_nrpe' command definition
    define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30
    }

    Here is what I have in my services.cfg:

    define service{
    use basic-service
    name load-service
    notification_options n
    check_command check_nrpe!check_load
    register 0
    }

    Are these correct?

  4. #4
    Join Date
    Dec 2006
    Posts
    288
    Got it! Changed the line in my commands.cfg file to:

    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$

    Thanks for your assistance!

  5. #5
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    You need to specify host_name in the services.cfg file.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  6. #6
    Join Date
    Dec 2006
    Posts
    288
    Actually, here is the services.cfg:
    define service{
    use basic-service
    name load-service
    notification_options n
    check_command check_nrpe!check_load
    register 0
    }
    define service{
    use load-service
    service_description LOAD
    contact_groups einsteins
    hostgroup_name load-clients
    }

    We have the host_name defined in hosts.cfg and then they are put in a group in hostgroups.cfg

  7. #7
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Well, hostname/IP is defined in hosts.cfg file, but when you add a serivce for a particualr host, how will nagios recognize for which host you are adding the service if host_name option is not specified?

    You can check remote server load from command line as follows.

    Code:
    /usr/local/nagios/libexec/check_nrpe -H IP -p 5666 -c check_load
    Last edited by david510; 01-21-2008 at 02:20 AM.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  8. #8
    Join Date
    Dec 2006
    Posts
    288
    I have Nagios running great, but can't seem to get notifications. For the example below, I have purposefully altered the check_hda1 on remote server to give an error in Nagios, and it will not send an email. I have also manually tested, successfully via shell, the commands in commands.cfg for notify-by-email and host-notify-by-email. Any suggestions on what I am missing? Here is my configuration for this one service only.

    ---- nagios.cfg ----
    enable_notifications=1

    ---- contacts.cfg ----
    define contact{
    contact_name Master
    alias Master
    service_notification_period 24x7
    host_notification_period 24x7
    service_notification_options w,u,c,r,f,s
    host_notification_options d,u,r,f,s
    service_notification_commands notify-by-email
    host_notification_commands host-notify-by-email
    email [email protected]
    }

    --- contactgroups.cfg ---
    define contactgroup{
    contactgroup_name techsupport
    alias techsupport
    members Master
    }

    ---- hosts.cfg ----
    define host{
    name generic-host ; Generic template name
    notifications_enabled 1 ; Host notifications are enabled
    event_handler_enabled 1 ; Host 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
    retain_nonstatus_information 1 ; Retain non-status information
    register 0 ; DONT REGISTER THIS DEFINITION
    }
    define host{
    name basic-host
    use generic-host
    check_command check-host-alive
    max_check_attempts 15
    notification_interval 5
    notification_period 24x7
    notification_options d,u,r,f,s
    register 0
    }
    define host{
    use basic-host
    host_name testname1
    alias TEST
    address xxx.xxx.xxx.xxx
    contact_groups techsupport
    notification_options d,u,r,f,s
    check_command check-host-alive
    max_check_attempts 10
    notification_interval 30
    notification_period 24x7
    #overrides the basic-host option
    }

    ---- hostsgroups.cfg ----
    define hostgroup{
    hostgroup_name disk-clients
    alias disk clients
    members testname1
    }

    --- services.cfg ---
    define service{
    name generic-service ; Generic service name
    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
    obsess_over_service 1 ; We should obsess over this service
    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
    retain_nonstatus_information 1 ; Retain non-status information
    register 0 ; DONT REGISTER THIS DEFINITION
    }
    define service{
    use generic-service
    name DISK-service
    is_volatile 0
    check_period 24x7
    max_check_attempts 15
    normal_check_interval 720
    retry_check_interval 5
    notification_interval 0
    notification_period 24x7
    register 0
    }
    define service{
    use DISK-service
    name disk-service
    notification_options w,u,c,r
    check_command check_nrpe!check_hda1
    register 0
    }
    define service{
    use disk-service
    service_description DISK
    contact_groups techsupport
    hostgroup_name disk-clients
    }

  9. #9
    Join Date
    Dec 2006
    Posts
    288
    Accidently found that answer by waiting. Apparently, Nagios does not send the notification until the max_check_attempts 15 value has been met. So for me, I just lowered that value and it works great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •