From e51a9ff6782fd425101f9e796ca37d1caaed39d2 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 14 Oct 2019 20:25:01 -0500 Subject: [PATCH 1/4] Add the `check_systemd_service` command --- pack/commands.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pack/commands.cfg b/pack/commands.cfg index 96260fa..29be142 100644 --- a/pack/commands.cfg +++ b/pack/commands.cfg @@ -9,3 +9,8 @@ define command { command_name check_supervisor_process command_line $PLUGINSDIR$/check_rattail_daemon_by_ssh.py -H $HOSTADDRESS$ -p $_HOSTSSH_PORT$ -u $_HOSTSSH_USER$ -i $_HOSTSSH_KEY$ -P "$_HOSTSSH_KEY_PASSPHRASE$" -r "check-supervisor-process $ARG1$" } + +define command { + command_name check_systemd_service + command_line $PLUGINSDIR$/check_rattail_daemon_by_ssh.py -H $HOSTADDRESS$ -p $_HOSTSSH_PORT$ -u $_HOSTSSH_USER$ -i $_HOSTSSH_KEY$ -P "$_HOSTSSH_KEY_PASSPHRASE$" -r "check-systemd-service $ARG1$" +} From 602848cd9dfe4a4a8d7d1c2324b008db7929dc4b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 14 Oct 2019 20:25:55 -0500 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8216bb3..11be77c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to rattail-shinken will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.6] - 2019-10-14 +### Changed +- Add the `check_systemd_service` command. + ## [0.5] - 2018-12-12 ### Changed - Add `check_supervisor_process` command. diff --git a/package.json b/package.json index 7c865eb..4f01fd1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rattail", "types": ["pack"], - "version": "0.5", + "version": "0.6", "homepage": "https://rattailproject.org/", "author": "Lance Edgar", "contributors": [ From dec2561db283047eaf3c5b7b43519f425859df97 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 28 Jan 2022 17:02:36 -0600 Subject: [PATCH 3/4] Improve error handling when remote check fails --- libexec/check_rattail_daemon_by_ssh.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libexec/check_rattail_daemon_by_ssh.py b/libexec/check_rattail_daemon_by_ssh.py index 1ce64c2..5aa0391 100755 --- a/libexec/check_rattail_daemon_by_ssh.py +++ b/libexec/check_rattail_daemon_by_ssh.py @@ -108,7 +108,11 @@ if __name__ == '__main__': # Ok now connect, and try to get values for memory client = schecks.connect(hostname, port, ssh_key_file, passphrase, user) - result, exitcode = execute_check(client, check_path) - - print result - sys.exit(exitcode) + result = execute_check(client, check_path) + if result is False: + print("failed to execute remote check!") + sys.exit(3) + else: + output, exitcode = result + print(output) + sys.exit(exitcode) From 7ec8690d7289f1a2ad80926c9c15b0bcc7012131 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 13 Sep 2024 18:24:34 -0500 Subject: [PATCH 4/4] build: ignore some files --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~