Skip to content

Commit

Permalink
Add make install for source install. Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jomann09 committed Feb 15, 2023
1 parent aeac425 commit 806aca0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ GOTEST=$(GOCMD) test
VERSION?=$(shell cat VERSION)
BINARY_NAME=rcagent
DIR_NAME=rcagent-$(VERSION)
LOCAL_DIR=/usr/local/rcagent
VFLAGS=-X github.com/rechecked/rcagent/internal/config.Version=$(VERSION)
LDFLAGS?=

.PHONY: build test clean
.PHONY: build test clean install

all: help

Expand Down Expand Up @@ -35,6 +36,11 @@ build-dmg:
cp build/package/macos/uninstall.sh build/$(DIR_NAME)/uninstall.sh
cd build && hdiutil create -volname $(DIR_NAME) -srcfolder $(DIR_NAME) -ov -format UDZO $(DIR_NAME).dmg

install:
mkdir -p $(LOCAL_DIR)/plugins
cp -f build/bin/$(BINARY_NAME) $(LOCAL_DIR)/$(BINARY_NAME)
cp -n build/package/config.yml $(LOCAL_DIR)/config.yml

test:
$(GOTEST) -v ./...

Expand All @@ -51,6 +57,8 @@ help:
@echo 'Targets:'
@echo ' build build the binary'
@echo ''
@echo ' install install rcagent into /usr/local'
@echo ''
@echo ' build-rpm build rpm package'
@echo ' build-deb build deb package'
@echo ' build-dmg build dmg package'
Expand Down
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,37 @@

ReChecked Agent (rcagent) is light-weight, cross-platform, API-based agent that is compatible with Nagios (using NRDP and check_rcagent) check-based monitoring systems.

To install from source, ensure golang is installed and run:
### For Binary Installs

go install https://github.com/rechecked/rcagent
Download from GitHub releases or [download from rechecked.io](https://rechecked.io/download)

For binary installs:
### For Source Install

Download from GitHub releases or [download from rechecked.io](https://rechecked.io/download)
To build from source, ensure golang is installed and download the souce, then run:

```
make build
```

To install the source version, run the following:

```
make install
```

If you'd like to run the source version as a service, you can install the service by running

```
/usr/local/rcagent/rcagent -a install
```

### Using rcagent

You can read how to [get started](https://rechecked.io/quick-start-guide/) and you can install the config wizard or plugin below.

- **Nagios XI** - Download and install the latest [ReChecked Nagios XI Config Wizard](https://rechecked.io/download) in the XI GUI.
- **Nagios Core** - Download the [check_rcagent.py](https://rechecked.io/download) file, place it in `/usr/local/nagios/libexec`.

### Config Options

For a full list of config options in config.yml, check the [config options page](https://rechecked.io/config-options/).

0 comments on commit 806aca0

Please sign in to comment.