[Windows] Web Api install?

Started by pzandvoort, September 06, 2017, 12:16:20 AM

Previous topic - Next topic

pzandvoort

I feel dumb for asking this, but going to ask anyway: Using a standard out-of-the-box netxms installation on Windows, how do you install the WebApi?

I understand that the WebUI runs on Jetty so there should already be a server. How do we add the web api to this so we have something to point Grafana to?

Many thanks!

Ēriks Jenkēvics

Hi! You can find the .war file for the WebAPI on the NetXMS download page --> https://netxms.org/download/, under the Integration Tools section, then you need to add it to your already configured and running web server or if you`re already running the Web Console, you can deploy it on the same server.

rukeser

#2
Quote from: Ēriks Jenkēvics on September 06, 2017, 01:09:10 PM
Hi! You can find the .war file for the WebAPI on the NetXMS download page --> https://netxms.org/download/, under the Integration Tools section, then you need to add it to your already configured and running web server or if you`re already running the Web Console, you can deploy it on the same server. kitchen lola
Didn't know it was that easy thanks.

pzandvoort

Thanks Eriks.

I installed the webui using the installer. This seems to install a minimal installation of Jetty, pointed at the webui. I'm a Windows guy and thus (almost by definition) pretty ignorant when it comes to deploying anything Java related! I download the web service .war - now where do I put it so that Jetty can pick it up and serve it?

Thanks!

Peter

Ēriks Jenkēvics

You can following the guide here https://wiki.eclipse.org/Jetty/Howto/Using_Jetty_Runner, it explains how to use the Jetty Runner which comes with the installation of the WebUI. The jetty-runner.jar file should be within the directory where the WebUI is installed.

pzandvoort

Here's what I ended up doing. Good or bad, it seems to work :)


  • In the webui folder (probably C:\Netxms\WebUI), make a folder called "webapi".
  • Download the webapi .war file and save it in the webapi folder as "webapi.war"
  • Create a jetty-web.xml file in the webapi folder, 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>
  • In the registry, update HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\nxWebUI\Parameters\Start\Params and add the following line at the end:
    C:\NetXMS\WebUI\webapi\jetty-web.xml (change as appropriate to point to the jetty-web.xml file you made in the previous step)
  • Restart the NetXMS WebUI service.
The webapi should now be available at http://localhost:8080/webapi

Hope this helps somebody!
Peter


Ēriks Jenkēvics

#6
Great work! Thanks for the detailed instructions, I will definitely reference this post in the future :)

EDIT: I`ll actually do one better, I`ll add these instructions to our Wiki :)

amitayb

thanks for this great guide. I've finally make grafana integrate with NETXMS on windows :)

raindrop

In the registry, update HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\nxWebUI\Parameters\Start\Params and add the following line at the end: 


Hi pzandvoort

I am having issues with this line as the reg line is correct till you get you to nxWebUI I only have nxreportd in the path. 
Web access is working fine for user access.
I am on window 2022std. Can you elaborate on the reg entry? This was also put on the WIKI .... BUT half of the info was missing.  https://wiki.netxms.org/wiki/Deploy_NetXMS_WebAPI_using_the_WebUI_Windows_installer_(Windows_only!)

Thanks

PS: it would be nice to have clear, concise instructions in the documentation from the developers in this.