Changed icinga to nagios

parent 61c0eddb
......@@ -4,7 +4,7 @@ monitoring_user: 'ffhb-monitoring'
monitoring_group: 'ffhb-monitoring'
monitoring_subdomain: 'monitoring'
monitoring_domain: '{{ monitoring_subdomain }}.{{ main_domain }}'
monitoring_icinga_version: 1.14.2
monitoring_nagios_plugins_version: 2.2.1
monitoring_nagios_version: 4.4.6
monitoring_nagios_plugins_version: 2.3.3
monitoring_global_access_contact: 'nagiosadmin'
monitoring_check_multi_version: 0.26
monitoring_global_access_contactgroup: 'icingaadmin'
define hostgroup {
hostgroup_name gluon-nodes
}
define service {
use generic-service
hostgroup_name gluon-nodes
service_description Gluon version up-to-date
check_command check_gluon_version
check_interval 720
}
define hostgroup {
hostgroup_name vpn-servers
}
define service {
use generic-service
hostgroup_name vpn-servers
service_description Gatemon
check_command check_gatemon
}
#! /usr/bin/env bash
# 2014, Moritz Kaspar Rudert (mortzu) <mr@planetcyborg.de>.
# 2014, mortzu <mortzu@gmx.de>.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are
......
......@@ -28,7 +28,7 @@ my $ssh_cmd = 'ssh ' . $port . ' -o PreferredAuthentications=keyboard-interactiv
my $output = qx{$ssh_cmd};
my ($accepted) = ($output =~ m/^Permission denied \((.*)\)\./);
my ($accepted) = ($output =~ m/Permission denied \((.*)\)\./);
if (not $accepted) {
say "Unable to parse ssh output: $output";
......
[Unit]
Description=nagios
After=network.target
[Service]
ExecStart=%h/.opt/nagios/bin/nagios %h/.config/etc/nagios/nagios.cfg
[Install]
WantedBy=default.target
#! /usr/bin/env bash
exec multilog t ./main
This diff is collapsed.
command[ IPv4 ] = /home/{{ monitoring_user }}/.opt/icinga/libexec/check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1 -t 5
command[ IPv6 ] = /home/{{ monitoring_user }}/.opt/icinga/libexec/check_ping -6 -H $HOSTADDRESS6$ -w 3000.0,80% -c 5000.0,100% -p 2
command[ IPv4 ] = /home/{{ monitoring_user }}/.opt/nagios-plugins/libexec/check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1 -t 5
command[ IPv6 ] = /home/{{ monitoring_user }}/.opt/nagios-plugins/libexec/check_ping -6 -H $HOSTADDRESS6$ -w 3000.0,80% -c 5000.0,100% -p 2
state [ CRITICAL ] = COUNT(CRITICAL) > 1
state [ WARNING ] = COUNT(WARNING) > 0 || COUNT(CRITICAL) > 0
......
......@@ -7,5 +7,4 @@ define service {
hostgroup_name etckeeper-servers
service_description etckeeper
check_command check_via_ssh!check_etckeeper
servicegroups security
}
......@@ -9,7 +9,7 @@ RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
<If "%{HTTPS} == 'on'">
AuthName "Icinga Access"
AuthType Basic
AuthUserFile /var/www/{{ monitoring_user }}/domains/{{ monitoring_subdomain }}.{{ main_domain }}/.htpasswd
AuthUserFile /var/www/{{ monitoring_user }}/domains/{{ monitoring_domain }}/.htpasswd
AuthMerging And
Require valid-user
</If>
log_file=/home/{{ monitoring_user }}/.opt/nagios/var/nagios.log
cfg_file=/home/{{ monitoring_user }}/.config/etc/nagios/objects/timeperiods.cfg
cfg_file=/home/{{ monitoring_user }}/.config/etc/nagios/objects/templates.cfg
cfg_dir=/home/{{ monitoring_user }}/.config/etc/nagios/objects/commands
cfg_dir=/home/{{ monitoring_user }}/.config/etc/nagios/contacts_enabled
cfg_dir=/home/{{ monitoring_user }}/.config/etc/nagios/servers_enabled
cfg_dir=/home/{{ monitoring_user }}/.config/etc/nagios/hostgroups_enabled
object_cache_file=/home/{{ monitoring_user }}/.opt/nagios/var/objects.cache
precached_object_file=/home/{{ monitoring_user }}/.opt/nagios/var/objects.precache
resource_file=/home/{{ monitoring_user }}/.config/etc/nagios/resource.cfg
status_file=/home/{{ monitoring_user }}/.opt/nagios/var/status.dat
status_update_interval=10
nagios_user={{ monitoring_user }}
nagios_group={{ monitoring_group }}
check_external_commands=1
command_file=/home/{{ monitoring_user }}/.opt/nagios/var/rw/nagios.cmd
lock_file=/home/{{ monitoring_user }}/.var/tmp/nagios.lock
temp_file=/home/{{ monitoring_user }}/.opt/nagios/var/nagios.tmp
temp_path=/tmp
event_broker_options=-1
log_rotation_method=d
log_archive_path=/home/{{ monitoring_user }}/.opt/nagios/var/archives
use_syslog=0
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_current_states=1
log_external_commands=1
log_passive_checks=1
service_inter_check_delay_method=s
max_service_check_spread=30
service_interleave_factor=s
host_inter_check_delay_method=s
max_host_check_spread=30
max_concurrent_checks=0
check_result_reaper_frequency=10
max_check_result_reaper_time=30
check_result_path=/home/{{ monitoring_user }}/.opt/nagios/var/spool/checkresults
max_check_result_file_age=3600
cached_host_check_horizon=15
cached_service_check_horizon=15
enable_predictive_host_dependency_checks=1
enable_predictive_service_dependency_checks=1
soft_state_dependencies=0
auto_reschedule_checks=0
auto_rescheduling_interval=30
auto_rescheduling_window=180
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
ochp_timeout=5
perfdata_timeout=5
retain_state_information=1
state_retention_file=/home/{{ monitoring_user }}/.opt/nagios/var/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=1
retained_host_attribute_mask=0
retained_service_attribute_mask=0
retained_process_host_attribute_mask=0
retained_process_service_attribute_mask=0
retained_contact_host_attribute_mask=0
retained_contact_service_attribute_mask=0
interval_length=60
check_for_updates=1
bare_update_check=0
use_aggressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
execute_host_checks=1
accept_passive_host_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=0
obsess_over_services=0
obsess_over_hosts=0
translate_passive_host_checks=0
passive_host_checks_are_soft=0
check_for_orphaned_services=1
check_for_orphaned_hosts=1
check_service_freshness=1
service_freshness_check_interval=60
service_check_timeout_state=c
check_host_freshness=0
host_freshness_check_interval=60
additional_freshness_latency=15
enable_flap_detection=1
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=us
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0
admin_email=email@localhost
admin_pager=pager@localhost
daemon_dumps_core=0
use_large_installation_tweaks=0
enable_environment_macros=0
debug_level=0
debug_verbosity=1
debug_file=/home/{{ monitoring_user }}/.opt/nagios/var/nagios.debug
max_debug_file_size=1000000
allow_empty_hostgroup_assignment=0
define command {
command_name check_host_alive_4
command_line $USER1$/check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 3
}
define command {
command_name check_host_alive_6
command_line $USER1$/check_ping -6 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 3
}
define command {
command_name check_multi
command_line /home/{{ monitoring_user }}/.opt/check_multi/libexec/check_multi -l $USER1$ -t 20 -s HOSTADDRESS=$HOSTADDRESS$ -s HOSTADDRESS6=$HOSTADDRESS$ -f /home/{{ monitoring_user }}/.config/etc/nagios/$ARG1$ $ARG2$ $ARG3$ $ARG4$
}
define command {
command_name notify-none
command_line /bin/true
}
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-host-by-jabber
command_line /bin/echo "$NOTIFICATIONTYPE$ ($HOSTSTATE$) of host $HOSTNAME$: $HOSTOUTPUT$" | /home/ffhb-monitoring/.local/bin/sendxmpp -t -n "$CONTACTPAGER$"
}
define command {
command_name notify-service-by-jabber
command_line /bin/echo "$NOTIFICATIONTYPE$ ($SERVICESTATE$) of $SERVICEDESC$ on host $HOSTALIAS$: $SERVICEOUTPUT$" | /home/ffhb-monitoring/.local/bin/sendxmpp -t -n "$CONTACTPAGER$"
}
#######################################
# notification commands
#######################################
define command {
command_name notify-none
command_line /bin/true
command_name check_via_snmp
command_line $USER2$/check_snmp_extend $HOSTADDRESS$ '$ARG1$' '$ARG2$' 2c 30
}
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-host-by-jabber
command_line /bin/echo "$NOTIFICATIONTYPE$ ($HOSTSTATE$) of host $HOSTNAME$: $HOSTOUTPUT$" | /home/ffhb-monitoring/.local/bin/sendxmpp -t -n "$CONTACTPAGER$"
}
define command {
command_name notify-service-by-jabber
command_line /bin/echo "$NOTIFICATIONTYPE$ ($SERVICESTATE$) of $SERVICEDESC$ on host $HOSTALIAS$: $SERVICEOUTPUT$" | /home/ffhb-monitoring/.local/bin/sendxmpp -t -n "$CONTACTPAGER$"
}
#######################################
# host check commands
#######################################
define command {
command_name check_host_alive_4
command_line $USER1$/check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 3
}
define command {
command_name check_host_alive_6
command_line $USER1$/check_ping -6 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 3
}
define command {
command_name check_multi
command_line /home/ffhb-monitoring/.opt/check_multi/libexec/check_multi -l $USER1$ -t 20 -s HOSTADDRESS=$HOSTADDRESS$ -s HOSTADDRESS6=$HOSTADDRESS6$ -f /home/ffhb-monitoring/.opt/icinga/etc/$ARG1$ $ARG2$ $ARG3$ $ARG4$
}
#######################################
# remote check commands
#######################################
define command {
command_name check_via_ssh
command_line $USER1$/check_by_ssh -t 60 -o User=rnagios -o StrictHostKeyChecking=no -o CheckHostIP=no -i /home/ffhb-monitoring/.ssh/id_rsa_mon -H '$HOSTADDRESS$' '$ARG1$'
command_line $USER1$/check_by_ssh -t 60 -o User=rnagios -o StrictHostKeyChecking=no -o CheckHostIP=no -H '$HOSTADDRESS$' '$ARG1$'
}
define command {
command_name build_master_ssh_tunnel
command_line /usr/local/lib/nagios/build_master_ssh_tunnel $HOSTADDRESS$
}
#######################################
# service check commands
#######################################
define command {
command_name check_dns
command_line $USER2$/check_dns -4 -H $HOSTADDRESS$ -s $HOSTADDRESS$
......@@ -90,11 +38,6 @@ define command {
command_line $USER2$/check_mail_no_relay $HOSTADDRESS$
}
define command {
command_name check_gatemon
command_line $USER2$/check_gatemons.py -u https://status.ffhb.de -s $HOSTNAME$ -i 'addresses_ipv6' -a 3600
}
define command {
command_name check_gluon_version
command_line $USER2$/check_gluon_version $HOSTNAME$
......
......@@ -18,7 +18,6 @@ define host{
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1
check_interval 5
......@@ -50,7 +49,7 @@ define host {
define host {
name linux-server-dualstack
use linux-server
check_command check_multi!check_multi_host_dualstack.cmd -r 1+2+4+8
check_command check_multi!check_multi_host_dualstack.cmd -r 1+4+8
register 0
}
......@@ -85,7 +84,6 @@ define service {
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
......
define servicegroup{
servicegroup_name dnslookup
alias DNS-Lookups
}
define servicegroup{
servicegroup_name reachability
alias Service reachability
}
define servicegroup{
servicegroup_name hardware
alias Harware status
}
define servicegroup{
servicegroup_name ressource
alias Ressource usage
}
define servicegroup{
servicegroup_name services
alias Running services
}
define servicegroup{
servicegroup_name webpages
alias Hostet web pages
}
define servicegroup{
servicegroup_name security
alias Security
}
$USER1$=/home/{{ monitoring_user }}/.opt/nagios-plugins/libexec
$USER2$=/home/{{ monitoring_user }}/.opt/nagios-plugins-custom
#! /usr/bin/env bash
# These environment variables are sometimes needed by the running daemons
export USER={{ monitoring_user }}
export HOME=/home/{{ monitoring_user }}
# Now let's go!
exec $HOME/.opt/icinga/bin/icinga $HOME/.opt/icinga/etc/icinga.cfg 2>&1
#! /usr/bin/env bash
PATH="/home/{{ monitoring_user }}/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/{{ monitoring_user }}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/{{ monitoring_user }}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/{{ monitoring_user }}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/{{ monitoring_user }}/perl5"; export PERL_MM_OPT;
/home/{{ monitoring_user }}/.opt/sendxmpp/sendxmpp $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment