Skip to content

Commit

Permalink
Merge pull request #2 from jtsunne/add-readme
Browse files Browse the repository at this point in the history
add Readme
  • Loading branch information
jtsunne authored Aug 26, 2024
2 parents c06800d + caec026 commit e122934
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Nagios-ES

## Description

This is a Nagios plugin that checks the status of Elasticsearch cluster.

## Build

```
go build -o check_es .
```

## Usage

```
check_es --es_url=http://<domain>:<port> --check=<check_name> --w=50 --c=90
```

### Options

- `es_url`: Elasticsearch URL (format: http://<domain>:<port>)
- `check`: Check name
- `health`: Check cluster health
- `node_count`: Overall nodes count (W/C required)
- `data_node_count`: Check data nodes count (W/C required)
- `cpu_usage`: Check node CPU usage (W/C required)
- If filter will be used, it will check the CPU usage of the specific node
- If filter is not used, it will check the maximum CPU usage of all nodes
- `heap_size`: Check node Head usage (W/C required)
- If filter will be used, it will check the Heap usage of the specific node
- If filter is not used, it will check the maximum Heap usage of all nodes
- `disk_usage`: Check node Disk usage (W/C required)
- If filter will be used, it will check the Disk usage of the specific node
- If filter is not used, it will check the maximum Disk usage of all nodes
- `w`: Warning threshold
- `c`: Critical threshold
For filtering node specific checks, you can use the following options:
- `node_ip`: Node IP address for node specific checks
- `node_name`: Node name for node specific checks

## Example

```
./check_es --es_url=http://<domain>:<port> --check=health
```

OK Output:
```
OK: Cluster health is green | 'time'=19ms;;;;
```

Warning Output:
```
WARNING: Cluster health is yellow, relocating shards: 0 | 'active_shards'=5;;;; 'relocating_shards'=0;;;; 'time'=24ms;;;; 'unassigned_shards'=3;;;;
```

0 comments on commit e122934

Please sign in to comment.