Skip to content

Commit 3a8e27d

Browse files
authored
Merge pull request #21 from wbollock/feat/nagioscore_support
feat: Nagios Core support
2 parents 61051cf + b277b32 commit 3a8e27d

File tree

2 files changed

+412
-191
lines changed

2 files changed

+412
-191
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
![Go Report Card](https://goreportcard.com/badge/github.com/wbollock/nagios_exporter)
66
[![contributions](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat")](https://github.com/wbollock/nagios_exporter/issues)
77

8-
98
A Prometheus exporter currently supporting:
109

1110
* Nagios XI
11+
* Nagios Core 4
12+
* Nagios Core 3
13+
* CheckMK
1214

1315
It includes metrics on the current state and configuration of Nagios. This includes the number of hosts, services, and information about their monitoring setup. For example, this exporter will output the number of flapping hosts, passive checks, or hosts in downtime.
1416

@@ -21,6 +23,7 @@ Practical use cases for this exporter may include:
2123
This exporter does not output Nagios check results as Prometheus metrics; it is designed to export metrics of the Nagios monitoring server itself for meta-monitoring.
2224

2325
## Table of Contents
26+
2427
- [nagios_exporter](#nagios_exporter)
2528
- [Table of Contents](#table-of-contents)
2629
- [Configuration](#configuration)
@@ -56,6 +59,29 @@ To see all available configuration flags:
5659
./prometheus-nagios-exporter -h
5760
```
5861

62+
### Nagios Core 3/4 support
63+
64+
This exporter also supports Nagios Core 3/4 and CheckMK, albeit with a subset of metrics and reliance on the `nagiosstats` binary. There is no RESTful API for either monitoring platform, so the exporter must be run directly on the Nagios host and have access to execute `nagiostats`.
65+
66+
It is also recommended to pass the path of the Nagios configuration
67+
68+
Typical location and usage of the binary:
69+
70+
* Nagios Core 3/4:
71+
* `--nagios.stats_binary`: `/usr/local/nagios/bin/nagiostats`
72+
* `--nagios.config_path`: `/usr/local/nagios/etc/nagios.cfg`
73+
* CheckMK:
74+
* `--nagios.stats_binary`: `/omd/sites/<your-site>/bin/nagiostats`
75+
* `--nagios.config_path`: `/omd/sites/<your-site>/tmp/nagios/nagios.cfg`
76+
77+
Example usage:
78+
79+
```bash
80+
./nagios_exporter --nagios.stats_binary "/usr/local/nagios/bin/nagiostats" --nagios.config_path "/usr/local/nagios/etc/nagios.cfg"
81+
```
82+
83+
Note that this flag nullifies all others. It cannot be used in conjunction with the Nagios XI API.
84+
5985
## Installation
6086

6187
### Debian/RPM package
@@ -93,12 +119,24 @@ Import the [dashboard](grafana/dashboard.json) template ([instructions](https://
93119

94120
## Troubleshooting
95121

96-
Ensure `nagios_up` returns `1`, otherwise please check your API key and Nagios reachability, such as:
122+
Ensure `nagios_up` returns `1`.
123+
124+
### NagiosXI
125+
126+
Please check your API key and Nagios reachability:
97127

98128
```bash
99129
curl -GET "http://<nagios_url>/nagiosxi/api/v1/objects/host?apikey=<apikey>&pretty=1"
100130
```
101131

132+
### Nagios Core 3/4, CheckMK
133+
134+
Ensure the user running the Nagios Exporter can execute `nagiostats` fully:
135+
136+
```bash
137+
sudo su <prometheus-user> -s /bin/bash -c "/usr/local/nagios/bin/nagiostats -c /usr/local/nagios/etc/nagios.cfg"
138+
```
139+
102140
## Resources Used
103141

104142
* [haproxy_expoter](https://github.com/prometheus/haproxy_exporter/blob/main/haproxy_exporter.go)

0 commit comments

Comments
 (0)