WebAPI Struggles

Started by Yavor, June 08, 2018, 12:26:07 PM

Previous topic - Next topic

Yavor

Hi guys,

I'm trying to set up the WebAPI so I can use Grafana with NetXMS but I'm running into some issues. I have the netxms-websvc-2.2.6.war file (renamed to webapi.war) - tried both downloading it and building it myself with Maven, didn't make a difference. I've placed the file in the C:\NetXMS\WebUI\WebUI\webapi directory together with a jetty-web.xml file with the following content:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/webapi</Set>
  <Set name="war"><SystemProperty name="jetty.home"/>\webapi\webapi.war</Set>
  <Set name="tempDirectory">webapi</Set>
</Configure>


I've added the following line to the Params value under HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\nxWebUI\Parameters\Start:

QuoteC:\NetXMS\WebUI\WebUI\webapi\jetty-web.xml

So far, so good, the problem is that when I open http://localhost:8080/webapi/ in the browser I get this:

Quote{"description":"Internal error","error":46}

When I enter http://172.16.1.70:8080/webapi/ in the Grafana new datasource settings and click on "Save & Test", I get a "HTTP Error Bad Request" error.

Any ideas how to get this working?

Thanks

Victor Kirhenshtein

Hi,

you should turn on both "Basic Auth" and "With Credentials".

Best regards,
Victor

Yavor

Silly me! Thanks a lot, Victor.