Page 1 of 1

API just to retrun "recordcount" value

Posted: Mon Jan 07, 2019 2:13 pm
by nagwindmon
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": {
....

Re: API just to retrun "recordcount" value

Posted: Mon Jan 07, 2019 3:27 pm
by npolovenko
Hello, @nagwindmon. You can just grep the word "recordcount".
[root@centos7x64 conf]# curl -s -XGET "http://192.168.3.3/nagiosxi/api/v1/obje ... c&pretty=1" | grep "recordcount"
"recordcount": "4",
Would this work?

Re: API just to retrun "recordcount" value

Posted: Mon Jan 07, 2019 5:59 pm
by nagwindmon
yep, that would do it, thanks!

Re: API just to retrun "recordcount" value

Posted: Tue Jan 08, 2019 1:10 pm
by npolovenko
@nagwindmon, No problem. I will be closing this thread but feel free to open a new one if anything else comes up.