Skip to content

Commit

Permalink
Merge pull request #133 from ccztux/devel
Browse files Browse the repository at this point in the history
Release 2.2.9
  • Loading branch information
ccztux authored Dec 9, 2020
2 parents ad0b083 + dae164e commit 46a0df3
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 72 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: Makefile for the modpd NEB module
#
Expand Down
82 changes: 41 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ service nagios status
Check if the modpd NEB module was loaded by Nagios®:
```bash
[root@lab01]:~# grep -i modpd /usr/local/nagios/var/nagios.log
[1582272717] modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.8
[1582272717] modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.9
[1582272717] modpd: Starting...
[1582272717] Event broker module '/usr/local/nagios/include/modpd.o' initialized successfully.
```
Expand Down Expand Up @@ -336,8 +336,8 @@ vim /usr/local/nagios/etc/send_nsca.cfg
Usage: modpd OPTIONS
Author: Christian Zettel (ccztux)
Last modification: 2020-12-08
Version: 2.2.8
Last modification: 2020-12-09
Version: 2.2.9
Description: modpd (Monitoring Obsessing Data Processor Daemon)
Expand Down Expand Up @@ -365,9 +365,9 @@ OPTIONS:
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: Config file for modpd (Monitoring Obsessing Data Processor Daemon)
#
Expand Down Expand Up @@ -613,48 +613,48 @@ modpd (PID 6931) is running [ OK ]
Stopping modpd [ OK ]
[root@lab01]:~# grep 6931 /usr/local/modpd/var/log/modpd.log
2020-12-08 12:07:53 | 6931 | setLock | Script lock directory exists and permissions are ok
2020-12-08 12:07:53 | 6931 | setLock | Setting lock...
2020-12-08 12:07:53 | 6931 | setLock | Setting lock was successful
2020-12-08 12:07:53 | 6931 | checkNamedPipe | Check if named pipe: '/usr/local/modpd/var/rw/modpd.cmd' exists and if it is read/writeable...
2020-12-08 12:07:53 | 6931 | checkNamedPipe | Named pipe doesnt exist
2020-12-08 12:07:53 | 6931 | createNamedPipe | Creating named pipe...
2020-12-08 12:07:53 | 6931 | createNamedPipe | Creating named pipe was successful
2020-12-08 12:07:53 | 6931 | buildJobCommand | Building job command...
2020-12-08 12:07:53 | 6931 | buildJobCommand | We build the following job command: '/usr/bin/timeout --signal=TERM 8 /usr/bin/php /usr/local/modpd/libexec/send_nrdp.php --usestdin --delim="" --token="[HIDDEN FOR SECURITY]" --url=https://nrdpuser:[HIDDEN FOR SECURITY]@10.0.0.74:443/nrdp'
2020-12-08 12:07:53 | 6931 | _main | Ready to handle jobs...
2020-12-08 12:08:24 | 6931 | logStats | ---- Stats for the last 31 seconds ----
2020-12-08 12:08:24 | 6931 | logStats | modpd is running: 0d 0h 0m 31s
2020-12-08 12:08:24 | 6931 | logStats | Total processed jobs: '4', successful processed jobs: '4', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-08 12:08:24 | 6931 | logStats | Handled host checks: '1011', handled service checks: '751', invalid datasets received: '0'
2020-12-08 12:08:54 | 6931 | logStats | ---- Stats for the last 30 seconds ----
2020-12-08 12:08:54 | 6931 | logStats | modpd is running: 0d 0h 1m 1s
2020-12-08 12:08:54 | 6931 | logStats | Total processed jobs: '5', successful processed jobs: '5', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-08 12:08:54 | 6931 | logStats | Handled host checks: '1095', handled service checks: '751', invalid datasets received: '0'
2020-12-08 12:09:21 | 6931 | signalHandler | Caught: 'SIGTERM', preparing for shutdown...
2020-12-08 12:09:21 | 6931 | logStats | ---- Stats for the last 27 seconds ----
2020-12-08 12:09:21 | 6931 | logStats | modpd is running: 0d 0h 1m 28s
2020-12-08 12:09:21 | 6931 | logStats | Total processed jobs: '5', successful processed jobs: '5', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-08 12:09:21 | 6931 | logStats | Handled host checks: '1018', handled service checks: '749', invalid datasets received: '0'
2020-12-08 12:09:21 | 6931 | signalHandler | Caught: 'EXIT', shutting down...
2020-12-08 12:09:21 | 6931 | checkNamedPipe | Check if named pipe: '/usr/local/modpd/var/rw/modpd.cmd' exists and if it is read/writeable...
2020-12-08 12:09:22 | 6931 | checkNamedPipe | Named pipe exists and it is read/writeable
2020-12-08 12:09:22 | 6931 | removeNamedPipe | Remove named pipe...
2020-12-08 12:09:22 | 6931 | removeNamedPipe | Removing named pipe was successful
2020-12-08 12:09:22 | 6931 | checkLock | Check if lock file: '/usr/local/modpd/var/lock/modpd.lock' exists and if it is read and writeable...
2020-12-08 12:09:22 | 6931 | checkLock | Lock file exists and it is read/writeable
2020-12-08 12:09:22 | 6931 | removeLock | Removing lock...
2020-12-08 12:09:22 | 6931 | removeLock | Removing lock was successful
2020-12-08 12:09:22 | 6931 | signalHandler | Exitcode: '143'
2020-12-08 12:09:22 | 6931 | signalHandler | modpd was running: 0d 0h 1m 29s
2020-12-08 12:09:22 | 6931 | signalHandler | Bye, bye...
2020-12-09 12:07:53 | 6931 | setLock | Script lock directory exists and permissions are ok
2020-12-09 12:07:53 | 6931 | setLock | Setting lock...
2020-12-09 12:07:53 | 6931 | setLock | Setting lock was successful
2020-12-09 12:07:53 | 6931 | checkNamedPipe | Check if named pipe: '/usr/local/modpd/var/rw/modpd.cmd' exists and if it is read/writeable...
2020-12-09 12:07:53 | 6931 | checkNamedPipe | Named pipe doesnt exist
2020-12-09 12:07:53 | 6931 | createNamedPipe | Creating named pipe...
2020-12-09 12:07:53 | 6931 | createNamedPipe | Creating named pipe was successful
2020-12-09 12:07:53 | 6931 | buildJobCommand | Building job command...
2020-12-09 12:07:53 | 6931 | buildJobCommand | We build the following job command: '/usr/bin/timeout --signal=TERM 8 /usr/bin/php /usr/local/modpd/libexec/send_nrdp.php --usestdin --delim="" --token="[HIDDEN FOR SECURITY]" --url=https://nrdpuser:[HIDDEN FOR SECURITY]@10.0.0.74:443/nrdp'
2020-12-09 12:07:53 | 6931 | _main | Ready to handle jobs...
2020-12-09 12:08:24 | 6931 | logStats | ---- Stats for the last 31 seconds ----
2020-12-09 12:08:24 | 6931 | logStats | modpd is running: 0d 0h 0m 31s
2020-12-09 12:08:24 | 6931 | logStats | Total processed jobs: '4', successful processed jobs: '4', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-09 12:08:24 | 6931 | logStats | Handled host checks: '1011', handled service checks: '751', invalid datasets received: '0'
2020-12-09 12:08:54 | 6931 | logStats | ---- Stats for the last 30 seconds ----
2020-12-09 12:08:54 | 6931 | logStats | modpd is running: 0d 0h 1m 1s
2020-12-09 12:08:54 | 6931 | logStats | Total processed jobs: '5', successful processed jobs: '5', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-09 12:08:54 | 6931 | logStats | Handled host checks: '1095', handled service checks: '751', invalid datasets received: '0'
2020-12-09 12:09:21 | 6931 | signalHandler | Caught: 'SIGTERM', preparing for shutdown...
2020-12-09 12:09:21 | 6931 | logStats | ---- Stats for the last 27 seconds ----
2020-12-09 12:09:21 | 6931 | logStats | modpd is running: 0d 0h 1m 28s
2020-12-09 12:09:21 | 6931 | logStats | Total processed jobs: '5', successful processed jobs: '5', unsuccessful processed jobs: '0', timed out jobs: '0'
2020-12-09 12:09:21 | 6931 | logStats | Handled host checks: '1018', handled service checks: '749', invalid datasets received: '0'
2020-12-09 12:09:21 | 6931 | signalHandler | Caught: 'EXIT', shutting down...
2020-12-09 12:09:21 | 6931 | checkNamedPipe | Check if named pipe: '/usr/local/modpd/var/rw/modpd.cmd' exists and if it is read/writeable...
2020-12-09 12:09:22 | 6931 | checkNamedPipe | Named pipe exists and it is read/writeable
2020-12-09 12:09:22 | 6931 | removeNamedPipe | Remove named pipe...
2020-12-09 12:09:22 | 6931 | removeNamedPipe | Removing named pipe was successful
2020-12-09 12:09:22 | 6931 | checkLock | Check if lock file: '/usr/local/modpd/var/lock/modpd.lock' exists and if it is read and writeable...
2020-12-09 12:09:22 | 6931 | checkLock | Lock file exists and it is read/writeable
2020-12-09 12:09:22 | 6931 | removeLock | Removing lock...
2020-12-09 12:09:22 | 6931 | removeLock | Removing lock was successful
2020-12-09 12:09:22 | 6931 | signalHandler | Exitcode: '143'
2020-12-09 12:09:22 | 6931 | signalHandler | modpd was running: 0d 0h 1m 29s
2020-12-09 12:09:22 | 6931 | signalHandler | Bye, bye...
```


## modpd NEB module log snippet
```
[root@lab01]:~# grep -i modpd /usr/local/nagios/var/nagios.log
[1607079032] modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.8
[1607079032] modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.9
[1607079032] modpd: Starting...
[1607079032] Event broker module '/usr/local/nagios/include/modpd.o' initialized successfully.
[1607079332] modpd: The modpd NEB module is running 0d 0h 5m 0s
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.8
2.2.9
4 changes: 2 additions & 2 deletions etc/init.d/modpd
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: init script for modpd (Monitoring Obsessing Data Processor Daemon)
#
Expand Down
4 changes: 2 additions & 2 deletions etc/logrotate.d/modpd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: logrotate config file for modpd (Monitoring Obsessing Data Processor Daemon)
#
Expand Down
4 changes: 2 additions & 2 deletions etc/sysconfig/modpd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: Config parameters for the init script of the modpd daemon
# (Monitoring Obsessing Data Processor Daemon)
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: Makefile for the modpd NEB module
#
Expand Down
8 changes: 4 additions & 4 deletions src/modpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* Project website: https://github.com/ccztux/modpd
*
* Last Modification: Christian Zettel (ccztux)
* 2020-12-08
* 2020-12-09
*
* Version 2.2.8
* Version 2.2.9
*
* Description: NEB module to write obsessing data to unix socket
* Based on example: nagioscore/module/helloworld.c
Expand Down Expand Up @@ -83,12 +83,12 @@ int nebmodule_init(int flags, char *args, nebmodule *handle)
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_TITLE, "modpd");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_AUTHOR, "Christian Zettel (ccztux)");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_TITLE, "Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_VERSION, "2.2.8");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_VERSION, "2.2.9");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_LICENSE, "GPL v2");
neb_set_module_info(modpd_module_handle, NEBMODULE_MODINFO_DESC, "Obsessing NEB Module.");

/* log module info to the Nagios log file */
write_to_all_logs("modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.8", NSLOG_INFO_MESSAGE);
write_to_all_logs("modpd: Copyright © 2017-2020 Christian Zettel (ccztux), all rights reserved, Version: 2.2.9", NSLOG_INFO_MESSAGE);

/* log a message to the Nagios log file */
snprintf(temp_buffer, sizeof(temp_buffer) - 1, "modpd: Starting...\n");
Expand Down
31 changes: 17 additions & 14 deletions usr/local/modpd/bin/modpd
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: modpd (Monitoring Obsessing Data Processor Daemon)
#
Expand Down Expand Up @@ -549,14 +549,14 @@ checkRequiredBinaries()
then
if [ "${BASH_VERSINFO[0]}" -ge "4" ] && [ "${BASH_VERSINFO[1]}" -ge "2" ]
then
date_bin_printf="1"
g_date_bin_printf="1"
date_bin="printf"
else
date_bin_printf="0"
g_date_bin_printf="0"
required_binaries+=("date")
fi
else
date_bin_printf="0"
g_date_bin_printf="0"
fi

if [ "${job_timeout_enabled}" == "1" ]
Expand Down Expand Up @@ -661,7 +661,9 @@ calculateFunctionNameLength()

logHandlerSetConfig()
{
if [ "${date_bin_printf:-}" -eq "1" ]
g_log_conf="0"

if [ "${g_date_bin_printf:-}" -eq "1" ]
then
g_date_cmd_format_prefix="'%("
g_date_cmd_format_suffix=")T\\n' -1"
Expand Down Expand Up @@ -1544,14 +1546,20 @@ _main()
g_pid="${$}"
g_argc="${#}"
g_name="${0##*/}"
g_version="2.2.8"
g_version="2.2.9"
g_author="Christian Zettel (ccztux)"
g_copyright="Copyright © 2017-2020 ${g_author}, all rights reserved"
g_project_website="https://github.com/ccztux/${g_name}"
g_last_modification_date="2020-12-08"
g_last_modification_date="2020-12-09"
g_minimal_required_bash_version="3"
g_license="GNU GPLv2"
g_description="${g_name} (Monitoring Obsessing Data Processor Daemon)"
g_another_instance_is_running="0"
g_bypass_exit_routines="0"
g_config_file_included="0"
g_log_requirements_ok="0"
g_start_time=
g_exit_code="255"
g_file_permission="0"
g_permission_execute="1"
g_permission_write="2"
Expand All @@ -1560,10 +1568,6 @@ g_regular_file_exists="8"
g_regular_file_is_not_empty="16"
g_is_directory="32"
g_is_named_pipe="64"
g_another_instance_is_running="0"
g_bypass_exit_routines="0"
g_config_file_included="0"
g_log_requirements_ok="0"
g_log_conf="0"
g_log_to_file="1"
g_log_to_stdout="2"
Expand All @@ -1572,9 +1576,8 @@ g_log_to_journal="8"
g_date_bin_available="16"
g_logger_bin_available="32"
g_systemd_cat_bin_available="64"
g_start_time=
g_exit_code="255"
g_function_names_max_length="0"
g_date_bin_printf=
g_date_cmd_format_prefix=
g_date_cmd_format_suffix=
g_monitoring_data_separator="\\x1e"
Expand Down
4 changes: 2 additions & 2 deletions usr/local/modpd/etc/modpd.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# Project website: https://github.com/ccztux/modpd
#
# Last Modification: Christian Zettel (ccztux)
# 2020-12-08
# 2020-12-09
#
# Version 2.2.8
# Version 2.2.9
#
# Description: Config file for modpd (Monitoring Obsessing Data Processor Daemon)
#
Expand Down

0 comments on commit 46a0df3

Please sign in to comment.