Page MenuHomeDevCentral

D3297.id8489.diff
No OneTemporary

D3297.id8489.diff

diff --git a/roles/monitoring/init.sls b/roles/monitoring/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/init.sls
@@ -0,0 +1,10 @@
+# -------------------------------------------------------------
+# Salt — Monitoring
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .naemon
+ - .thruk
diff --git a/roles/monitoring/naemon/config.sls b/roles/monitoring/naemon/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/config.sls
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Salt — Monitoring - Naemon
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# Main configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.etc }}/naemon:
+ file.recurse:
+ - source: salt://roles/monitoring/naemon/files/etc
+ - dir_mode: 755
+ - file_mode: 644
diff --git a/roles/monitoring/naemon/files/etc/conf.d/commands.cfg b/roles/monitoring/naemon/files/etc/conf.d/commands.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/commands.cfg
@@ -0,0 +1,167 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Commands
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/commands.cfg
+# Description: Command definitions referenced in hosts/services/contacts
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Notifications
+#
+# :: notify-host-by-email
+# :: notify-service-by-email
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define command {
+ command_name notify-host-by-email
+ command_line /usr/bin/printf "%b" "***** Naemon *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" \
+ | /usr/local/bin/mail \
+ -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
+}
+
+define command {
+ command_name notify-service-by-email
+ command_line /usr/bin/printf "%b" "***** Naemon *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" \
+ | /usr/local/bin/mail \
+ -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
+}
+
+# -------------------------------------------------------------
+# Checks for hosts
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define command {
+ command_name check-host-alive
+ command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
+}
+
+# -------------------------------------------------------------
+# Generic checks for local services
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define command {
+ command_name check_local_disk
+ command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
+}
+
+define command {
+ command_name check_local_load
+ command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
+}
+
+define command {
+ command_name check_local_procs
+ command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
+}
+
+define command {
+ command_name check_local_users
+ command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
+}
+
+define command {
+ command_name check_local_swap
+ command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
+}
+
+define command {
+ command_name check_local_mrtgtraf
+ command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
+}
+
+# -------------------------------------------------------------
+# Checks for common services
+#
+# Those checks can be used to monitor both local and remote hosts.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define command {
+ command_name check_ftp
+ command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_hpjd
+ command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_snmp
+ command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_http
+ command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
+}
+
+# 'check_ssh' command definition
+define command {
+ command_name check_ssh
+ command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
+}
+
+define command {
+ command_name check_dhcp
+ command_line $USER1$/check_dhcp $ARG1$
+}
+
+define command {
+ command_name check_ping
+ command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
+}
+
+define command {
+ command_name check_pop
+ command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_imap
+ command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_smtp
+ command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
+}
+
+define command {
+ command_name check_tcp
+ command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
+}
+
+define command {
+ command_name check_udp
+ command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
+}
+
+define command {
+ command_name check_nt
+ command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
+}
+
+# -------------------------------------------------------------
+# Performance data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define command {
+ command_name process-host-perfdata
+ command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" \
+ >> $USER2$/host-perfdata.out
+}
+
+define command {
+ command_name process-service-perfdata
+ command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" \
+ >> $USER2$/service-perfdata.out
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/contacts.cfg b/roles/monitoring/naemon/files/etc/conf.d/contacts.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/contacts.cfg
@@ -0,0 +1,28 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Commands
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/contacts.cfg
+# Description: Contacts and contact groups referenced in hosts and services
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+define contact {
+ contact_name naemonadmin
+ alias Naemon Admin
+ use generic-contact
+ email naemon@localhost
+}
+
+define contactgroup {
+ contactgroup_name admins
+ alias Naemon Administrators
+ members naemonadmin
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/localhost.cfg b/roles/monitoring/naemon/files/etc/conf.d/localhost.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/localhost.cfg
@@ -0,0 +1,91 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Commands
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/localhost.cfg
+# Description: Monitoring for the local machine where Naemon runs
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Host
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define host {
+ host_name localhost
+ alias localhost
+ address 127.0.0.1
+ use linux-server
+}
+
+# -------------------------------------------------------------
+# Host group
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define hostgroup {
+ hostgroup_name linux-servers
+ alias Linux Servers
+ members localhost
+}
+
+# -------------------------------------------------------------
+# Services
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define service {
+ service_description PING
+ host_name localhost
+ use local-service
+ check_command check_ping!100.0,20%!500.0,60%
+}
+
+define service {
+ service_description Root Partition
+ host_name localhost
+ use local-service
+ check_command check_local_disk!20%!10%!/
+}
+
+define service {
+ service_description Total Processes
+ host_name localhost
+ use local-service
+ check_command check_local_procs!250!400!RSZDT
+}
+
+define service {
+ service_description Current Load
+ host_name localhost
+ use local-service
+ check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
+}
+
+define service {
+ service_description Swap Usage
+ host_name localhost
+ use local-service
+ check_command check_local_swap!20%!10%
+}
+
+define service {
+ service_description SSH
+ host_name localhost
+ use local-service
+ check_command check_ssh
+ notifications_enabled 0
+}
+
+define service {
+ service_description HTTP
+ host_name localhost
+ use local-service
+ check_command check_http!-u /
+ notifications_enabled 0
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/templates/contacts.cfg b/roles/monitoring/naemon/files/etc/conf.d/templates/contacts.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/templates/contacts.cfg
@@ -0,0 +1,48 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Templates
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/templates/contacts.cfg
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Contact templates
+#
+# As it's a template, register is set at 0.
+#
+# For hosts notifications options:
+# :: d - DOWN state
+# :: u - UNREACHABLE state
+#
+# For services notifications options:
+# :: w - warning
+# :: c - critical
+# :: u - unknown
+#
+# For both hosts and services:
+# :: r - recoveries
+# :: f - flapping events
+# :: s - scheduled downtime
+#
+# Commands are defined in conf.d/commands.cfg
+# Time periods are defined in conf.d/timeperiods.cfg
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define contact {
+ name generic-contact
+ host_notification_commands notify-host-by-email
+ host_notification_options d,u,r,f,s
+ host_notification_period 24x7
+ register 0
+ service_notification_commands notify-service-by-email
+ service_notification_options w,u,c,r,f,s
+ service_notification_period 24x7
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/templates/hosts.cfg b/roles/monitoring/naemon/files/etc/conf.d/templates/hosts.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/templates/hosts.cfg
@@ -0,0 +1,57 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Templates
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/templates/hosts.cfg
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Hosts templates
+#
+# As there are templates, register is set at 0.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define host {
+ name generic-host
+ event_handler_enabled 1
+ flap_detection_enabled 1
+
+ notification_period 24x7
+ notifications_enabled 1
+
+ process_perf_data 1
+
+ register 0
+
+ retain_nonstatus_information 1
+ retain_status_information 1
+}
+
+define host {
+ name linux-server
+ use generic-host
+
+ check_command check-host-alive
+ check_interval 5
+ check_period 24x7
+
+ contact_groups admins
+
+ max_check_attempts 10
+
+ notification_interval 120
+ notification_options d,u,r
+ notification_period workhours
+
+ register 0
+
+ retry_interval 1
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/templates/services.cfg b/roles/monitoring/naemon/files/etc/conf.d/templates/services.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/templates/services.cfg
@@ -0,0 +1,52 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Services
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/templates/services.cfg
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Services templates
+#
+# As there are templates, register is set at 0.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define service {
+ name generic-service
+ check_freshness 0
+ check_interval 10
+ check_period 24x7
+ contact_groups admins
+ event_handler_enabled 1
+ flap_detection_enabled 1
+ is_volatile 0
+ max_check_attempts 3
+ notification_interval 60
+ notification_options w,u,c,r
+ notification_period 24x7
+ notifications_enabled 1
+ obsess_over_service 1
+ passive_checks_enabled 1
+ process_perf_data 1
+ register 0
+ retain_nonstatus_information 1
+ retain_status_information 1
+ retry_interval 2
+}
+
+define service {
+ name local-service
+ use generic-service
+ check_interval 5
+ max_check_attempts 4
+ register 0
+ retry_interval 1
+}
diff --git a/roles/monitoring/naemon/files/etc/conf.d/timeperiods.cfg b/roles/monitoring/naemon/files/etc/conf.d/timeperiods.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/conf.d/timeperiods.cfg
@@ -0,0 +1,73 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Time periods
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/conf.d/timeperiods.cfg
+# Description: Time periods used in notification definitions
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Default time periods
+#
+# Timezone is UTC.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+define timeperiod {
+ timeperiod_name 24x7
+ alias 24 Hours A Day, 7 Days A Week
+ monday 00:00-24:00
+ tuesday 00:00-24:00
+ wednesday 00:00-24:00
+ thursday 00:00-24:00
+ friday 00:00-24:00
+ saturday 00:00-24:00
+ sunday 00:00-24:00
+}
+
+define timeperiod {
+ timeperiod_name workhours
+ alias Normal Work Hours
+ monday 08:00-17:00
+ tuesday 08:00-17:00
+ wednesday 08:00-17:00
+ thursday 08:00-17:00
+ friday 08:00-17:00
+}
+
+define timeperiod {
+ timeperiod_name none
+ alias No Time Is A Good Time
+}
+
+define timeperiod {
+ name us-holidays
+ timeperiod_name us-holidays
+ alias U.S. Holidays
+ december 25 00:00-00:00 ; Christmas
+ january 1 00:00-00:00 ; New Years
+ july 4 00:00-00:00 ; Independence Day
+ monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
+ monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
+ thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
+}
+
+define timeperiod {
+ timeperiod_name 24x7_sans_holidays
+ alias 24x7 Sans Holidays
+ use us-holidays ; Get holiday exceptions from other timeperiod
+ monday 00:00-24:00
+ tuesday 00:00-24:00
+ wednesday 00:00-24:00
+ thursday 00:00-24:00
+ friday 00:00-24:00
+ saturday 00:00-24:00
+ sunday 00:00-24:00
+}
diff --git a/roles/monitoring/naemon/files/etc/module-conf.d/livestatus.cfg b/roles/monitoring/naemon/files/etc/module-conf.d/livestatus.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/module-conf.d/livestatus.cfg
@@ -0,0 +1,21 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/module-conf.d/livestatus.cfg
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Events broker - Livestatus
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+broker_module=/usr/local/lib/naemon-livestatus/livestatus.so /var/cache/naemon/live
+event_broker_options=-1
diff --git a/roles/monitoring/naemon/files/etc/naemon.cfg b/roles/monitoring/naemon/files/etc/naemon.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/naemon.cfg
@@ -0,0 +1,268 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/naemon.cfg
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# General configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+cfg_dir=/usr/local/etc/naemon/conf.d
+object_cache_file=/var/spool/naemon/objects.cache
+precached_object_file=/var/spool/naemon/objects.precache
+
+resource_file=/usr/local/etc/naemon/resource.cfg
+
+status_file=/var/spool/naemon/status.dat
+status_update_interval=10
+
+check_external_commands=1
+
+query_socket=/var/spool/naemon/naemon.qh
+
+command_file=/var/spool/naemon/naemon.cmd
+lock_file=/var/cache/naemon/naemon.pid
+
+temp_file=/var/spool/naemon/naemon.tmp
+temp_path=/var/cache/naemon
+
+check_workers=6
+
+# -------------------------------------------------------------
+# Logging
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+log_file=/var/log/naemon/naemon.log
+log_archive_path=/var/log/naemon/archives
+
+use_syslog=0
+
+log_notifications=1
+enable_notification_suppression_reason_logging=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
+
+# -------------------------------------------------------------
+# Checks
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+max_concurrent_checks=0
+
+check_result_path=/var/cache/naemon/checkresults
+
+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
+
+# -------------------------------------------------------------
+# Timeout
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+service_check_timeout=60
+host_check_timeout=30
+event_handler_timeout=30
+notification_timeout=30
+ocsp_timeout=5
+perfdata_timeout=5
+
+# -------------------------------------------------------------
+# State retention
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+retain_state_information=1
+
+state_retention_file=/var/spool/naemon/retention.dat
+
+retention_update_interval=60
+
+use_retained_program_state=1
+
+use_retained_scheduling_info=1
+
+retained_scheduling_randomize_window=60
+
+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
+
+# -------------------------------------------------------------
+# Advanced checks configuration
+#
+# :: interval_length is in seconds
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+interval_length=60
+
+use_aggressive_host_checking=0
+
+execute_service_checks=1
+
+accept_passive_service_checks=1
+
+execute_host_checks=1
+
+accept_passive_host_checks=1
+
+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
+
+# -------------------------------------------------------------
+# Flap detection
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+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
+
+# -------------------------------------------------------------
+# Notifications
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+enable_notifications=1
+
+# -------------------------------------------------------------
+# Event handlers
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+enable_event_handlers=1
+
+# -------------------------------------------------------------
+# Performance
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+process_performance_data=0
+
+host_perfdata_file= /var/spool/naemon/host-perfdata
+service_perfdata_file=/var/spool/naemon/service-perfdata
+
+# -------------------------------------------------------------
+# Distributed monitoring
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+obsess_over_services=0
+
+obsess_over_hosts=0
+
+translate_passive_host_checks=0
+
+# -------------------------------------------------------------
+# Date and time
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+date_format=iso8601
+use_timezone=Etc/UTC
+
+# -------------------------------------------------------------
+# Validation rules
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+illegal_object_name_chars=`~!$%^&*|'"<>?,()=
+illegal_macro_output_chars=`~$&|'"<>
+
+# -------------------------------------------------------------
+# Regexp
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+use_regexp_matching=0
+use_true_regexp_matching=0
+
+# -------------------------------------------------------------
+# Contacts
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+admin_email=naemon@localhost
+admin_pager=pagenaemon@localhost
+
+# -------------------------------------------------------------
+# Debug
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+#
+# :: debug_level values:
+#
+# -1 = Everything
+# 0 = Nothing
+# 1 = Functions
+# 2 = Configuration
+# 4 = Process information
+# 8 = Scheduled events
+# 16 = Host/service checks
+# 32 = Notifications
+# 64 = Event broker
+# 128 = External commands
+# 256 = Commands
+# 512 = Scheduled downtime
+# 1024 = Comments
+# 2048 = Macros
+#
+# :: debug_verbosity values:
+#
+# 0 = Brief output
+# 1 = More detailed
+# 2 = Very detailed
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+debug_level=0
+
+debug_verbosity=1
+
+debug_file=/var/log/naemon/debug.log
+max_debug_file_size=1000000
+
+# -------------------------------------------------------------
+# Compatibility
+#
+# :: If host_down_disable_service_checks is set at 1, any stats
+# on checks can be distorted.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+allow_empty_hostgroup_assignment=1
+
+host_down_disable_service_checks=0
+
+allow_circular_dependencies=0
+
+# -------------------------------------------------------------
+# Drop-in support for new modules
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+include_dir=module-conf.d
diff --git a/roles/monitoring/naemon/files/etc/resource.cfg b/roles/monitoring/naemon/files/etc/resource.cfg
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/etc/resource.cfg
@@ -0,0 +1,32 @@
+# -------------------------------------------------------------
+# Monitoring - Naemon - Resource File
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/etc/resource.cfg
+# Description: Macros $USERx$ where x is in [1, 256]
+# Those macros can then be used in configuration files.
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Path to Nagios plugins
+#
+# Matches nagios-plugins port on FreeBSD.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+$USER1$=/usr/local/libexec/nagios
+
+# -------------------------------------------------------------
+# Path to naemon performance data files directory
+#
+# Matches host_perfdata_file and service_perfdata_file
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+$USER2$=/var/spool/naemon
diff --git a/roles/monitoring/naemon/files/naemon.rc b/roles/monitoring/naemon/files/naemon.rc
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/files/naemon.rc
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# Naemon — rc configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/monitoring/naemon/files/naemon.rc
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+naemon_enable="YES"
diff --git a/roles/monitoring/naemon/init.sls b/roles/monitoring/naemon/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/init.sls
@@ -0,0 +1,11 @@
+# -------------------------------------------------------------
+# Salt — Monitoring
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .software
+ - .config
+ - .service
diff --git a/roles/monitoring/naemon/service.sls b/roles/monitoring/naemon/service.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/service.sls
@@ -0,0 +1,23 @@
+# -------------------------------------------------------------
+# Salt — Monitoring - Naemon
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains["os"] == "FreeBSD" %}
+
+/etc/rc.conf.d/naemon:
+ file.managed:
+ - source: salt://roles/monitoring/naemon/files/naemon.rc
+
+{% endif %}
+
+service_naemon:
+ service.running:
+ - name: naemon
+ - enable: True
diff --git a/roles/monitoring/naemon/software.sls b/roles/monitoring/naemon/software.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/naemon/software.sls
@@ -0,0 +1,23 @@
+# -------------------------------------------------------------
+# Salt — Monitoring - Naemon
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Naemon software
+#
+# Naemon is divided in two packages, as the event broker can be
+# customized.
+#
+# The default configuration relies on standard Nagios checks,
+# provided on FreeBSD by the nagios-plugins port.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+naemon_software:
+ pkg.installed:
+ - pkgs:
+ - naemon-core
+ - naemon-livestatus
+ - nagios-plugins
diff --git a/roles/monitoring/thruk/init.sls b/roles/monitoring/thruk/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/monitoring/thruk/init.sls
@@ -0,0 +1,7 @@
+# -------------------------------------------------------------
+# Salt — Monitoring - Thruk
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -25,6 +25,7 @@
- roles/dbserver-mysql
- roles/dbserver-pgsql
- roles/devserver
+ - roles/monitoring
- roles/webserver-alkane
- roles/webserver-core
- roles/webserver-legacy

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 11:02 (17 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257819
Default Alt Text
D3297.id8489.diff (35 KB)

Event Timeline