Home Directory Addons Passive Checks Radar - add hosts and services automatically

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Radar - add hosts and services automatically

Rating
0 votes
Favoured:
0
Current Version
1
Last Release Date
2012-11-28
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
License
GPL
Hits
63105
Files:
FileDescription
radarradar Perl script
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This Perl script generates automated config files with host and service definitions for nagios from passively received host and service checks.
WHAT IS IT WORTH?
-----------------
this script generates automated config files with host and
service definitions for nagios from passively received
host and service checks.

This might be useful if your nagios system runs in a
distributed environment with nagios instances sending
passive checks to a central nagios server or if you
have many hosts sending passive checks.

Normally, hosts and services based on passive checks must
be configured both on the nagios instance receiving
the checks and on the instance sending the checks This script
uses received passive checks to create automated host and service
definitions in the nagios configuration. This way
the configuration of the implied hosts and services must
only be made on the instance that sends the passive checks

Moreover this script can be used to make nagios and Munin
work together. You can run a Munin server and a nagios
server in parallel. The munin server sends its results as
passive checks to the nagios server. Then the
corresponding service and host definitions are generated
and included in the nagios configuration.


HOW DOES IT WORK?
-----------------
The instance that sends passive checks must send them to
the NSCA of the central nagios server. So be sure
you have configured the NSCA correctly

When a pssive check result is received by the nagios
instance and the corresponding host and service respectively
does not exist in the nagios configuration an error
occurs and is written to the nagios log file.

the radar script parses the nagios log file for these
errors and uses them to generate automated host and service
definitions in the nagios configuration.

As long as nagios is not reloaded passive host and
service checks keep causing errors in the nagios
log file. Thus, to avoid multiple host and service definitions
for the same host or service, the radar script parses the entire
nagios configuration.

As the nagios configuration may be very large the script
gets active only every fifteen minutes, working in the background as a daemon.
The time interval can be set to any desired value.

When running the radar script it is run in daemon mode instantly.
So use an init script to start/stop/restart the daemon


TEMPLATES
---------
the radar script only generates rudimentary host and service
information. To make them work a host and service template for
the generated hosts and services must be included into the
nagios configuration. The names of the templates are set
in the configuration of the radar script (see below).
You can use the following example templates.

define host{
name generic-radar-host
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
check_command check-host-alive
max_check_attempts 10
check_period 24x7
notification_interval 120
notification_options d,u,r
notification_period 24x7
contact_groups admins
active_checks_enabled 0
passive_checks_enabled 1
host_groups radarhosts
register 0
}


define service {
name generic-radar-service
check_command check_dummy
active_checks_enabled 0
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 10
retry_check_interval 2
contact_groups admins
notification_options w,u,c,r
notification_interval 120
notification_period 24x7
service_groups radarservices
register 0
}


CONFIGURATION
-------------
absolute path to the nagios log file
$NAGIOS_LOGFILE="/usr/local/nagios/var/nagios.log";

the absolute path to the directory where generated cfg-files
are to be stored
$CFG_DIRECTORY="/usr/local/nagios/etc/objects/radar";

the absolute path to the directory where the
nagios cfg files are kept
$NAGIOS_CONFIG="/usr/local/nagios/etc/objects/";

the nagios host template to use for generated
host definitions
$HOST_TEMPLATES="generic-radar-host";

the nagios service template to use for
generated service definitions
$SERVICE_TEMPLATES="generic-radar-service";

the nagios user
$NAGIOS_USER="nagios";

the nagios group
$NAGIOS_GROUP="nagios-cmd";

enable/disable logging (1=enabled)
$ENABLE_LOGGING=1;

directory to put the log file
$LOGFILE_DIRECTORY="/var/log/";

directory to put the pid file
$PID_FILE_DIRECTORY="/var/run/";


QUESTIONS?
----------
Mail to kevin.fuchs@hs-heilbronn.de