Skip to content

Commit

Permalink
update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
lausser committed Feb 1, 2017
1 parent 3b09bc8 commit c9db184
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 56 deletions.
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* 2017-02-01 3.2.8
modernize templates
* 2017-02-01 3.2.7
new macro %RECIPE_NAME%
* 2016-12-09 3.2.6
Expand Down
69 changes: 38 additions & 31 deletions recipes/default/templates/os_linux_default.tpl
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
{{ application|service("os_linux_default_check_ssh") }}
host_name {{ application.host_name }}
use os_linux_default
check_command check_ssh_connect!60!22
}

{#
{{ application|service("os_linux_default_check_shell") }}
host_name {{ application.host_name }}
{{ application|service("os_linux_default_check_controlmaster") }}
use os_linux_default
max_check_attempts 10
check_command check_ssh_login!60!22
}
#}

{{ application|service("os_linux_default_check_load") }}
host_name {{ application.host_name }}
use os_linux_default,srv-pnp
check_command check_by_ssh!60!$USER10$/lib/nagios/plugins/check_load -w 5.0,5.0,5.0 -c 10.0,10.0,10.0
max_check_attempts 1
check_interval 2
check_command check_ssh_controlmaster
}

{{ application|service("os_linux_default_check_swap") }}
host_name {{ application.host_name }}
use os_linux_default,srv-pnp
check_command check_by_ssh!60!$USER10$/lib/nagios/plugins/check_swap -w 15% -c 8%
define servicedependency {
name dependency_os_linux_default_check_controlmast
er_uc_{{ application.host_name }}
host_name {{ application.host_name }}
service_description os_linux_default_check_controlmaster
execution_failure_criteria u,c,p
notification_failure_criteria u,c
dependent_service_description os_linux_.*,\
!os_linux_default_check_controlmaster
}

{{ application|service("os_linux_default_check_crond") }}
use os_linux_default
host_name {{ application.host_name }}
{% if application.type.startswith('sles') %}
check_command check_by_ssh!60!$USER10$/lib/nagios/plugins/check_procs -w :10 -c 1: -C cron
{% if "sles" in application.type %}
check_command check_by_ssh!60!./{{ application.host.environment }}/lib/nagios/plugins/check_procs -w :100 -c 1: -C cron
{% else %}
check_command check_by_ssh!60!$USER10$/lib/nagios/plugins/check_procs -w :10 -c 1: -C crond
check_command check_by_ssh!60!./{{ application.host.environment }}/lib/nagios/plugins/check_procs -w :100 -c 1: -C crond
{% endif %}
}

{% if application.host.virtual == "ps" %}
{{ application|service("os_linux_default_check_ntp") }}
{{ application|service("os_linux_default_check_mailq") }}
use os_linux_default
host_name {{ application.host_name }}
check_interval 60
retry_interval 10
check_command check_by_ssh!60!$USER10$/local/lib/nagios/plugins/check_ntp_health
check_command check_by_ssh!180!PERL5LIB=./{{ application.host.environment }}/lib/nagios/plugins ./{{ application.host.environment }}/lib/nagios/plugins/check_mailq -w 1 -c 100 -t 120
}
{% else %}
{{ application|service("os_linux_default_check_uptime") }}

{{ application|service("os_linux_default_check_zombies") }}
use os_linux_default
host_name {{ application.host_name }}
check_interval 60
retry_interval 10
check_command check_by_ssh!60!./{{ application.host.environment }}/lib/nagios/plugins/check_procs -w 20 -c 40 -p 1 -s Z
}

{{ application|service("os_linux_default_check_swap") }}
use os_linux_default
check_command check_by_ssh!60!$USER10$/lib/nagios/plugins/check_uptime 30
host_name {{ application.host_name }}
check_command check_by_ssh!60!./{{ application.host.environment }}/lib/nagios/plugins/check_swap -w 5% -c 1%
check_interval 30
}
{% endif %}

{% if not application.filesystems %}
{{ application|service("os_linux_default_check_disks") }}
use os_linux_default
host_name {{ application.host_name }}
check_command check_by_ssh!60!./{{ application.host.environment }}/lib/nagios/plugins/check_disk -w 15% -c 10%
check_interval 30
}
{% endif %}
60 changes: 36 additions & 24 deletions recipes/default/templates/os_windows_default.tpl
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
{{ application|service("os_windows_default_check_nsclient") }}
host_name {{ application.host_name }}
use os_windows_default
check_command check_nrpe_arg!60!checkUpTime!MinWarn=5m MinCrit=1m
check_command check_nsc_web!30
_NSCPORT {{ application.NSCPORT }}
_NSCPASSWORD {{ application.NSCPASSWORD }}
}

{{ application|service("os_windows_default_check_cpu") }}
define servicedependency {
name dependency_os_windows_default_check_nsclient_uc_{{ application.host_name }}
host_name {{ application.host_name }}
service_description os_windows_default_check_nsclient
execution_failure_criteria u,c,p
notification_failure_criteria u,c
dependent_service_description os_windows_.*,\
!os_windows_default_check_nsclient
}

{{ application|service("os_windows_default_check_uptime") }}
host_name {{ application.host_name }}
use os_windows_default,srv-pnp
use os_windows_default,srv-perf
max_check_attempts 10
check_command check_nrpe_arg!60!checkCPU!warn=80 crit=90 time=5m time=1m time=30s
check_command check_nsc_web!30!check_uptime 'warning=uptime<180s' 'critical=uptime<60s'
_NSCPORT {{ application.NSCPORT }}
_NSCPASSWORD {{ application.NSCPASSWORD }}
}
{{ application|service("os_windows_default_check_mem") }}
{{ application|service("os_windows_default_check_cpu") }}
host_name {{ application.host_name }}
use os_windows_default,srv-pnp
check_command check_nrpe_arg!60!checkMem!MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged
use os_windows_default,srv-perf
max_check_attempts 10
check_command check_nsc_web!30!check_cpu 'filter=none' 'warning=load > 80' 'crit=load > 90'
_NSCPORT {{ application.NSCPORT }}
_NSCPASSWORD {{ application.NSCPASSWORD }}
}

{{ application|service("os_windows_default_check_autosvc") }}
{{ application|service("os_windows_default_check_mem") }}
host_name {{ application.host_name }}
use os_windows_default
check_command check_nrpe_arg!60!CheckServiceState!CheckAll
use os_windows_default,srv-perf
check_command check_nsc_web!30!check_memory 'filter=none' 'warning=free_pct < 10' 'crit=free_pct < 5'
_NSCPORT {{ application.NSCPORT }}
_NSCPASSWORD {{ application.NSCPASSWORD }}
}

{#
{{ application|service("os_windows_default_check_ntp") }}
{% if not application.filesystems %}
{{ application|service("os_windows_default_check_drives") }}
host_name {{ application.host_name }}
use os_windows_default
check_command windows-check_time!3600!360000
use os_windows_default,srv-perf
check_command check_nsc_web!30!check_drivesize 'warning=used > 95' 'crit=used > 98' "empty-state=unknown" "filter=type in ('fixed') AND mounted=1 AND name not like '\?\'" "show-all"
_NSCPORT {{ application.NSCPORT }}
_NSCPASSWORD {{ application.NSCPASSWORD }}
}
#}
{% endif %}

define servicedependency {
name dependency_os_windows_default_check_nsclient_uc_{{ application.host_name }}
host_name {{ application.host_name }}
service_description os_windows_default_check_nsclient
execution_failure_criteria u,c
notification_failure_criteria u,c
dependent_service_description os_windows_.*,\
!os_windows_default_check_nsclient
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run(self):


setup(name='coshsh',
version='3.2.7',
version='3.2.8',
description='Coshsh - config generator for monitoring systems',
url='http://github.com/lausser/coshsh',
author='Gerhard Lausser',
Expand Down

0 comments on commit c9db184

Please sign in to comment.