Team, a quick question, what parameters do I need to pass or how to formatted following API call to just get current host recordcount but without all host attributes?
curl -XGET "http://nagiosserver/nagiosxi/api/v1/obj ... x&pretty=1"
"hostlist": {
"recordcount": "12788",
"host": [
{
"@attributes": {
....
API just to retrun "recordcount" value
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: API just to retrun "recordcount" value
Hello, @nagwindmon. You can just grep the word "recordcount".
Would this work?[root@centos7x64 conf]# curl -s -XGET "http://192.168.3.3/nagiosxi/api/v1/obje ... c&pretty=1" | grep "recordcount"
"recordcount": "4",
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
nagwindmon
- Posts: 92
- Joined: Mon Dec 01, 2014 3:39 pm
Re: API just to retrun "recordcount" value
yep, that would do it, thanks!
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: API just to retrun "recordcount" value
@nagwindmon, No problem. I will be closing this thread but feel free to open a new one if anything else comes up.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.