Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mclarkson/nrcq
NagRestConf Query utility.
https://github.com/mclarkson/nrcq
Last synced: 9 days ago
JSON representation
NagRestConf Query utility.
- Host: GitHub
- URL: https://github.com/mclarkson/nrcq
- Owner: mclarkson
- Created: 2015-10-25T18:30:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-26T15:46:56.000Z (about 8 years ago)
- Last Synced: 2024-10-19T07:12:57.177Z (27 days ago)
- Language: Go
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```
nrcq(8) System Administration Utilities nrcq(8)
NAME
nrcq - NagRestConf Query utilitySYNOPSIS
nrcq [options] URL ENDPOINTDESCRIPTION
-c, --complete=false: Also show fields with empty values.
-d, --data=[]: Set extra data to send, 'option:value'.
The user should not urlencode data, nrcq will do it.
May be used multiple times.
-f, --filter="": A client side RE2 regex filter, 'option:regex[,option:regex]...'
-F, --folder="local": The system folder to query.
-j, --json=false: Output in JSON format.
-l, --list="": List all options for the specified table. Required fields are
preceded by a star, '*'.
-L, --listendpoints=false: List all endpoints/tables.
-p, --pack=false: Remove spaces and lines from the Json output.
-P, --password="": Password for Basic Auth.
-U, --username="": Username for Basic Auth.
-v, --version=false: Show the version of this program.EXAMPLES
Show all valid endpoints:
nrcq -LList all nagios options for the servicesets table:
nrcq -l servicesetsShow all hosts:
nrcq http://server/rest show/hostsShow a subset of hosts using a simple RE2 regular expression:
nrcq http://server/rest show/hosts -f "name:host2"Show a subset of services using a complex RE2 regular expression:
(See https://github.com/google/re2/wiki/Syntax)
nrcq http://server/rest show/services -f "name:\bhost2\b|web,svcdesc:(?i)swap"Add a new host:
nrcq http://server/rest add/hosts \
-d name:server1 \
-d alias:server1 \
-d ipaddress:server1.there.gq \
-d template:hsttmpl-local \
-d servicesets:example-linDelete a host and all of its services:
nrcq http://server/rest delete/services \
-d name:server1 \
-d "svcdesc:.*"
nrcq http://server/rest delete/hosts \
-d name:server1 \```
Compiled binaries are available for Linux, Mac and Windows at [sourceforge](https://sourceforge.net/projects/nagrestconf/files/nrcq).
To compile from source, install [Google Go](https://golang.org/dl/) and [Git](https://git-scm.com/downloads) then use:
go get github.com/mclarkson/nrcq
There is a short [REST Tutorial](http://nagrestconf.smorg.co.uk/documentation/resttut.php).