From 55e9a58ea28647f3050866960eb9ce1d97cf8750 Mon Sep 17 00:00:00 2001 From: chadliu23 Date: Sun, 7 Jul 2019 09:57:24 +0800 Subject: [PATCH 1/3] Avoid rtmp dump run over timeout --- check_rtmp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_rtmp.sh b/check_rtmp.sh index c1dd5a3..0a02374 100644 --- a/check_rtmp.sh +++ b/check_rtmp.sh @@ -69,9 +69,9 @@ NAME=`echo $URL | sed -e s/[^A-Za-z0-9.]/_/g` ERR=/tmp/check_rtmp_err_$NAME.tmp # Testejant -$RTMPDUMP --live -r $URL --stop $TIMEOUT > /dev/null 2> $ERR +$RTMPDUMP --live -r $URL --stop $TIMEOUT > /dev/null 2> $ERR & sleep 3 status=$? - +sleep 4 && ps -ef | grep "$RTMPDUMP --live -r $URL" | grep -v grep | awk '{print $2}' | xargs -r sudo kill -9 # Retorn de resultats CONNECTA=`grep "INFO: Connected" $ERR` From 1496c51aa62784482b1b63d3eecabf6c1758a12e Mon Sep 17 00:00:00 2001 From: chadliu23 Date: Sun, 7 Jul 2019 10:10:15 +0800 Subject: [PATCH 2/3] Add usage --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 877958f..3312a78 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,29 @@ It uses the rtmpdump (http://rtmpdump.mplayerhq.hu/) utility for connecting to a and determine if it's working or not. +## Usage + +Copy file `check_rtmp.sh` to `${nagios_home}/libexec/check_rtmp.sh` + +Add command to `${nagios_home}/etc/objects/commands.cfg` + +``` +define command{ + command_name check_rtmp + command_line $USER1$/check_rtmp.sh $ARG1$ +} + +``` + +In service (`${nagios_home}/etc/server/services.cfg`) + +``` +define service { + ... + check_command check_rtmp! -u -t +} +``` + AUTHOR: Toni Comerma DATE: jan-2013 From 873185034f4f368661600d70b6c77110eb2dcafd Mon Sep 17 00:00:00 2001 From: chadliu23 Date: Sun, 7 Jul 2019 10:18:34 +0800 Subject: [PATCH 3/3] Add author --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3312a78..e1f6d4f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ define service { AUTHOR: Toni Comerma DATE: jan-2013 +AUTHOR: chadliu23 +DATE: jul-2019 + Notes: - The plugin leaves temporary files under /tmp - You should not run concurrent executions of this plugin for the same stream name (as they will share the same temporary file) and