From e7f85f647e6f641bd85fbdfdb26982350f782370 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 20 Feb 2010 18:56:46 -0500 Subject: the debian package nagios-plugins and nagios-plugins-basic defines a number of the check_commands that were being defined by this module, this caused duplicate definition issues, so to solve this we don't define the subset of commands on debian/ubuntu systems that are handled by the package, but let other operatingsystems define them (as they were before) --- manifests/defaults/commands.pp | 80 +++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 24 deletions(-) (limited to 'manifests/defaults/commands.pp') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index c3190af..4e6933a 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -2,54 +2,86 @@ class nagios::defaults::commands { # common service commands - nagios_command { + case $operatingsystem { + debian,ubuntu: { + check_dummy: + command_line => '$USER1$/check_dummy $ARG1$'; + check-host-alive: + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; + check_ssh_port: + command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; + check_https_cert: + command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_http_url: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; + check_http_url_regex: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_https_url: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; + check_https_url_regex: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_mysql_db: + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; + check_ntp_time: + command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; + check_silc: + command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; + check_sobby: + command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; + check_jabber: + command_line => '$USER1$/check_jabber -H $ARG1$'; + } + default: { + nagios_command { check_dummy: - command_line => '$USER1$/check_dummy $ARG1$'; + command_line => '$USER1$/check_dummy $ARG1$'; check_ping: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$'; + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$'; check-host-alive: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; check_tcp: - command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$'; + command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$'; check_udp: - command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$'; + command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$'; check_load: - command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$'; + command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$'; check_disk: - command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$'; + command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$'; check_all_disks: - command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e'; + command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e'; check_ssh: - command_line => '$USER1$/check_ssh $HOSTADDRESS$'; + command_line => '$USER1$/check_ssh $HOSTADDRESS$'; check_ssh_port: - command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; + command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; check_http: - command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$'; check_https: - command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$'; check_https_cert: - command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; check_http_url: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; check_http_url_regex: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; check_https_url: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; check_https_url_regex: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; check_mysql: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$'; + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$'; check_mysql_db: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; check_ntp_time: - command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; + command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; check_silc: - command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; + command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; check_sobby: - command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; + command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; check_jabber: - command_line => '$USER1$/check_jabber -H $ARG1$'; + command_line => '$USER1$/check_jabber -H $ARG1$'; + } } + } # commands for services defined by other modules -- cgit v1.2.3 From b6df3ff3048f18585675299d63354af9b5516834 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 20 Feb 2010 19:05:31 -0500 Subject: add back the accidentally removed nagios_command piece --- manifests/defaults/commands.pp | 56 ++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'manifests/defaults/commands.pp') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 4e6933a..79e8f84 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -3,33 +3,35 @@ class nagios::defaults::commands { # common service commands case $operatingsystem { - debian,ubuntu: { - check_dummy: - command_line => '$USER1$/check_dummy $ARG1$'; - check-host-alive: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; - check_ssh_port: - command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; - check_https_cert: - command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; - check_http_url: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; - check_http_url_regex: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_https_url: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; - check_https_url_regex: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_mysql_db: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; - check_ntp_time: - command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; - check_silc: - command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; - check_sobby: - command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; - check_jabber: - command_line => '$USER1$/check_jabber -H $ARG1$'; + nagios_command { + debian,ubuntu: { + check_dummy: + command_line => '$USER1$/check_dummy $ARG1$'; + check-host-alive: + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; + check_ssh_port: + command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; + check_https_cert: + command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_http_url: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; + check_http_url_regex: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_https_url: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; + check_https_url_regex: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_mysql_db: + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; + check_ntp_time: + command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; + check_silc: + command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; + check_sobby: + command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; + check_jabber: + command_line => '$USER1$/check_jabber -H $ARG1$'; + } } default: { nagios_command { -- cgit v1.2.3 From cbc09b778fb1b517de1f464bcb2c21574c7ff090 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 20 Feb 2010 19:08:59 -0500 Subject: fix another syntax error from the previous commit --- manifests/defaults/commands.pp | 154 ++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'manifests/defaults/commands.pp') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 79e8f84..ba905d7 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -3,86 +3,86 @@ class nagios::defaults::commands { # common service commands case $operatingsystem { - nagios_command { debian,ubuntu: { - check_dummy: - command_line => '$USER1$/check_dummy $ARG1$'; - check-host-alive: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; - check_ssh_port: - command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; - check_https_cert: - command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; - check_http_url: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; - check_http_url_regex: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_https_url: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; - check_https_url_regex: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_mysql_db: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; - check_ntp_time: - command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; - check_silc: - command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; - check_sobby: - command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; - check_jabber: - command_line => '$USER1$/check_jabber -H $ARG1$'; + nagios_command { + check_dummy: + command_line => '$USER1$/check_dummy $ARG1$'; + check-host-alive: + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; + check_ssh_port: + command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; + check_https_cert: + command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_http_url: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; + check_http_url_regex: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_https_url: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; + check_https_url_regex: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_mysql_db: + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; + check_ntp_time: + command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; + check_silc: + command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; + check_sobby: + command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; + check_jabber: + command_line => '$USER1$/check_jabber -H $ARG1$'; + } } - } - default: { - nagios_command { - check_dummy: - command_line => '$USER1$/check_dummy $ARG1$'; - check_ping: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$'; - check-host-alive: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; - check_tcp: - command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$'; - check_udp: - command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$'; - check_load: - command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$'; - check_disk: - command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$'; - check_all_disks: - command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e'; - check_ssh: - command_line => '$USER1$/check_ssh $HOSTADDRESS$'; - check_ssh_port: - command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; - check_http: - command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$'; - check_https: - command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$'; - check_https_cert: - command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; - check_http_url: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; - check_http_url_regex: - command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_https_url: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; - check_https_url_regex: - command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; - check_mysql: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$'; - check_mysql_db: - command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; - check_ntp_time: - command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; - check_silc: - command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; - check_sobby: - command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; - check_jabber: - command_line => '$USER1$/check_jabber -H $ARG1$'; + default: { + nagios_command { + check_dummy: + command_line => '$USER1$/check_dummy $ARG1$'; + check_ping: + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$'; + check-host-alive: + command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; + check_tcp: + command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$'; + check_udp: + command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$'; + check_load: + command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$'; + check_disk: + command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$'; + check_all_disks: + command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e'; + check_ssh: + command_line => '$USER1$/check_ssh $HOSTADDRESS$'; + check_ssh_port: + command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; + check_http: + command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_https: + command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_https_cert: + command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; + check_http_url: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$'; + check_http_url_regex: + command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_https_url: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$'; + check_https_url_regex: + command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$'; + check_mysql: + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$'; + check_mysql_db: + command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$'; + check_ntp_time: + command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1'; + check_silc: + command_line => '$USER1$/check_tcp -p 706 -H $ARG1$'; + check_sobby: + command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; + check_jabber: + command_line => '$USER1$/check_jabber -H $ARG1$'; + } } - } } # commands for services defined by other modules -- cgit v1.2.3 From e945db2c0b06993c3f88eff7a4a4f98eadd2c66b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 20 Feb 2010 19:14:25 -0500 Subject: remove another duplicated check_command definition --- manifests/defaults/commands.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests/defaults/commands.pp') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index ba905d7..d51de2c 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -7,8 +7,6 @@ class nagios::defaults::commands { nagios_command { check_dummy: command_line => '$USER1$/check_dummy $ARG1$'; - check-host-alive: - command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1'; check_ssh_port: command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; check_https_cert: -- cgit v1.2.3 From 7cff057111729c6b31098053629b51020e6688b6 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 20 Feb 2010 22:11:12 -0500 Subject: remove check_ssh_port duplicate command definition --- manifests/defaults/commands.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests/defaults/commands.pp') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index d51de2c..05460f5 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -7,8 +7,6 @@ class nagios::defaults::commands { nagios_command { check_dummy: command_line => '$USER1$/check_dummy $ARG1$'; - check_ssh_port: - command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; check_https_cert: command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$'; check_http_url: -- cgit v1.2.3