I'm implemeting an automated procedure to add host to Nagios and include them in hostgroups. While doing so I just arrive to a point where I have a hostgroups with 253 elements inside and when I try to run an API call to apend one more host to it I'm hitting an error.
This is the output of the call (I have edited the list of servers to put just 3 but there would be 253 servers FQDN on that memebers section.
Code: Select all
{
"hostgroup_review": {
"changed": false,
"connection": "close",
"content": "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>414 Request-URI Too Long</title>\n</head><body>\n<h1>Request-URI Too Long</h1>\n<p>The requested URL's length exceeds the capacity\nlimit for this server.<br />\n</p>\n</body></html>\n",
"content_length": "248",
"content_type": "text/html; charset=iso-8859-1",
"date": "Fri, 25 Feb 2022 09:53:36 GMT",
"elapsed": 0,
"failed": false,
"failed_when_result": false,
"msg": "Status code was 414 and not [200]: HTTP Error 414: Request-URI Too Long",
"redirected": false,
"server": "Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k",
"status": 414,
"url": "https://nagios_url/nagiosxi/api/v1/config/hostgroup/W2K16?apikey=API_KEY&pretty=1&members=server1,server2,server3
Code: Select all
https://NAGIOS_URL/nagiosxi/api/v1/config/hostgroup/HOSTGROUP_NAME?apikey=xi_api_key&pretty=1&members=servers1,server2,server3