check_gl
The purpose of this plugin is to perform GET requests against the Graylog REST API endpoints.
check_gl
About
The purpose of this plugin is to perform GET
requests against the Graylog REST API endpoints.
The response is compliant with the Icinga plugin output format.
Disclaimer
Although used in some projects, I regard this plugin as a pamphlet and recommend others to view it for what it is: some lines scribbled on a napkin meanwhile on a beach :wink:
Getting started
See how you can browse through the Graylog API here
Install JSONPath
dependency with:
$ pip install -r requirements.txt
Instructions for installing Icinga plugins are here
Usage
Parameters:
-V, --version | (optional, displays script version)
-h, --help | (optional, displays this information)
-u, --user | (mandatory)
-p, --password | (mandatory)
-e, --endpoint ://:/ | (mandatory)
-f, --filter | (mandatory)
-c, --critical | (mandatory)
-w, --warning | (mandatory)
Example
./check_gl --endpoint http://localhost:12900/system/metrics/org.graylog2.buffers.process.usage --user dan --pass 1234 --filter buffers.input.utilization -c 50 -w 100
Some further improvements, at my earliest convenience:
- Units for
--warning
and--critical
paramters - Tests (most likely with nose2)
- Remove the nasty JSONPath dependency
- Enrich the output, as per the supported format by Icinga
- Refactoring as per PEP8
Naturally, pull requests are welcome.
License
This plugin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License or
(at your option) any later version.
This plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.