Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Netxms WebAPI and Grafana

Netxms WebAPI and Grafana

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 20.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    R
    RaoulP
    wrote on last edited by
    #1

    Hello,

    I need you help working with NetXms WebAPI over https.

    I deployed the NetXMS WebAPI using this guide https://wiki.netxms.org/wiki/Deploy_NetXMS_WebAPI_using_the_WebUI_Windows_installer_(Windows_only!).

    The API is working fine with URL : http://netxms.mydomain:8080/webapi/ and also i can connect to it from grafana.

    However when configuring grafana to use https and also set the following setting in grafana :cookie_secure = true, Grafana cannot collect data from  http://netxms.mydomain:8080/webapi/ .

    Not sure if I'm asking the right questions here but long story short - how can i make https://netxms.mydomain:8080/webapi/ accessible?

    Thank you,
    Raoul

    1 Reply Last reply
    0
    • S
      S
      Ēriks Jenkēvics
      wrote on last edited by
      #2

      Hi!

      If grafana is running in https mode, it will not accept datasources which are not from https url's.
      The guide is a bit of a hack to get the API working with the same built in web server that comes with the windows WebUI installation. What I can suggest is to deploy a dedicated web server like Apache Tomcat and following this guide, configure it for SSL usage https://www.mulesoft.com/tcat/tomcat-ssl

      Regards,
      Eriks

      1 Reply Last reply
      0
      • R
        R
        RaoulP
        wrote on last edited by
        #3

        Hi Eriks,

        Thank you for your response.

        I will follow the guide you provided.

        Regards,
        Raoul

        1 Reply Last reply
        0
        • R
          R
          RaoulP
          wrote on last edited by
          #4

          Hi again,

          So, I have deployed NetXMS WebAPI with Tomcat 9 instead of Jetty and it doesn't work even with http.
          I have attached the Catalina log and also Wireshark traces.
          Tried this with Tomcat 7 and 9.

          What am I doing wrong?

          The bellow error is showed :
          23-Mar-2018 09:49:52.812 SEVERE [http-nio-9080-exec-12] org.restlet.resource.ServerResource.doCatch Exception or error caught in server resource
           org.restlet.resource.ResourceException: Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request
              at org.restlet.resource.ServerResource.doHandle(ServerResource.java:527)
              at org.restlet.resource.ServerResource.post(ServerResource.java:1341)
              at org.restlet.resource.ServerResource.doHandle(ServerResource.java:606)
              at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:662)
              at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)
              at org.restlet.resource.ServerResource.handle(ServerResource.java:1020)
              at org.restlet.resource.Finder.handle(Finder.java:236)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
              at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77)
              at org.restlet.Application.handle(Application.java:385)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
              at org.restlet.Component.handle(Component.java:408)
              at org.restlet.Server.handle(Server.java:507)
              at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)
              at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)
              at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
          Caused by: java.net.ConnectException: Connection refused: connect
              at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
              at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
              at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
              at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
              at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
              at java.net.Socket.connect(Socket.java:589)
              at org.netxms.client.NXCSession.connect(NXCSession.java:1805)
              at org.netxms.client.NXCSession.connect(NXCSession.java:1778)
              at org.netxms.websvc.handlers.AbstractHandler.login(AbstractHandler.java:375)
              at org.netxms.websvc.handlers.Sessions.onPost(Sessions.java:78)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.restlet.resource.ServerResource.doHandle(ServerResource.java:508)
              ... 63 more

          23-Mar-2018 09:49:52.849 INFO [http-nio-9080-exec-12] org.restlet.engine.log.LogFilter.afterHandle 2018-03-23 09:49:52 10.2.56.130 status 10.3.57.29 9080 POST /webapi/sessions - 500 56 0 1206 http://10.3.57.29:9080 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 http://mydomain:8080/datasources/edit/12

          Thank you,
          Raoul


          12.PNG

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups