DevOps Classroom Series – 14/Jul/2020

Passive Checks and NRDP

  • Active Checks: Preview
  • Passive Checks: Preview

Configure Passive Checks

  • In the main nagios configuration (/usr/local/nagios/etc/nagios.cfg)
accept_passive_service_checks=1
accept_passive_host_checks=1
log_passive_checks=1
  • In the host definition
define host {
    use                         generic-host
    host_name                   linuxmachine1
    address                     192.168.0.11
    active_checks_enabled       0
    passive_checks_enabled      1
}
  • In the service definition
define service {
    use                         local-service
    host_name                   linuxmachine1
    service_description         diskspace
    active_checks_enabled       0
    passive_checks_enabled      1

}
  • Refer Here
  • Build a sample script around PROCESS_HOST_CHECK_RESULT to accept hostname, status code and output from check
#!/bin/bash

NOW=`date +%s`
HOST=$1
STATUS=$2
OUTPUT=$3

echo "[$NOW] PROCESS_HOST_CHECK_RESULT;$HOST;$STATUS;$OUTPUT \
     > /var/nagios/rw/nagios.cmd

exit 0

Using NRDP

  • NRDP is a technology for sending results to Nagios instance remotely. It provides simple API to send the results to Nagios Instance using HTTP Protocol
  • NRDP consists of two parts
    • Server: This part is responsible for receiving check results from remote hosts and passing them to nagios.
    • Client: The client part getts to data be send as commandline arguments it sends it across to server.
  • Refer Here

Monitoring Remote Hosts

  • For monitoring remote hosts

    • SSH
    • NRPE (Nagios Remote Plugin Executor)
  • NRPE is a client-server solution for running check commands on remote computers

  • NRPE uses TCP protocol with SSL encryption on top of it. Enabling encryption is optional.

  • NRPE communicates on 5666

  • NRPE Workflow Preview

  • NRPE can be downloaded from Refer Here

  • Installation instructions are available over here

  • To configure nagios with your config directories refer image below Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin