Skip to content

Commit

Permalink
Minor changes for $HOST_ADDRESS and update for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jomann09 committed Feb 13, 2024
1 parent 3ca628d commit f0b5877
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
02/04/2024 - 1.1.0
02/12/2024 - 1.1.0
==================
- Added integration with ReChecked Manager (https://rechecked.io/rechecked-manager/)
- Added debug logging with -D
- Added $LOCAL_MACHINEID to local variables available
- Added debug logging with -D option
- Added "Address" variable for Hosts in passive check configurations
- Added $HOST_ADDRESS variable, which to be used in plugin arguments for passive checks
- Updated $HOST to be $LOCAL_HOSTNAME for better local variable names
- Updated spec file to make installs on Ubuntu/Debian add the daemon to systemd
- Fixed issue with plugin output on error not showing stdout
Expand Down
6 changes: 5 additions & 1 deletion build/package/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pluginTypes:
.sh:
- /bin/sh
.py:
- python3
- python
.pl:
- perl
.php:
Expand Down Expand Up @@ -72,3 +72,7 @@ pluginTypes:
# options:
# warning: 10
# critical: 20

manager:
url: https://localhost:8080
apikey: 27F772B33B624CB9BB5A4ED6F331FC7B
8 changes: 8 additions & 0 deletions docs/config/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ In the YAML file, `checks` is a list of checks to run. You can have as many pass

This value is populated with the hostname of the system the rcagent is running on.

### `$HOST_ADDRESS`

The value of the host's `address` field. This variable can only be used n the plugin `args` but is available for the host and the services.

## Config Options

Options with a * next to them are **required**.
Expand All @@ -18,6 +22,10 @@ Options with a * next to them are **required**.

The hostname associated with the passive check.

### `address`

For hosts, you can define an address variable which sets `$HOST_ADDRESS` which can be used in plugin `args`.

### `servicename`

The service name (or service description, if a service check) associated with the passive check.
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func ParseConfigDir() {

// Loop over once more for services only and replace $HOST_ADDRESS for plugin args
for i, c := range CfgData.Checks {
if c.Servicename != "" && c.Options.Plugin != "" {
if c.Options.Plugin != "" {
for k, a := range c.Options.Args {
CfgData.Checks[i].Options.Args[k] = strings.ReplaceAll(a, "$HOST_ADDRESS", CfgData.HostAddrs[c.Hostname])
}
Expand Down

0 comments on commit f0b5877

Please sign in to comment.