Details

    • Improvement
    • Resolution: Won't Fix
    • Critical
    • None
    • None
    • API

    Description

      I had the need to get some info from observium into nagios (don't ask )
      But found some things not working with the new api, so here is a patch solving it!

      N.B. flight api must be moved to the /libs/ folder because of autoloading. (maybe it's should be included in the repo?)

      Attachments

        Activity

          [OBS-1605] Fixes for (new) API
          landy Mike Stupalov made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          landy Mike Stupalov made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          ok

          landy Mike Stupalov added a comment - ok

          Guess this can be closed now with the api official - Nice work

           

          Would it be possible to add some debug ? API not working for me using curl, but no problem using a browser. Always getting unauthenticated no matter what.

          [root@lnx01 ~]# curl -k -v -u api:api https://obtest.fqdn.net/api/v0/devices/debug
          * About to connect() to obtest.fqdn.net port 443 (#0)
          *   Trying 10.10.134.75...
          * Connected to obtest.fqdn.net (10.10.134.75) port 443 (#0)
          * Initializing NSS with certpath: sql:/etc/pki/nssdb
          * skipping SSL peer certificate verification
          * SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
          * Server certificate:
          *       subject: CN=obtest.fqdn.net
          *       start date: Mar 10 10:40:47 2016 GMT
          *       expire date: Mar 10 10:40:47 2018 GMT
          *       common name: obtest.fqdn.net
          *       issuer:
          * Server auth using Basic with user 'api'
          > GET /api/v0/devices/debug HTTP/1.1
          > Authorization: Basic YXBpOmFwaQ==
          > User-Agent: curl/7.29.0
          > Host: obtest.fqdn.net
          > Accept: */*
          >
          < HTTP/1.1 401 Unauthorized
          < Date: Fri, 12 May 2017 10:31:39 GMT
          < Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/7.0.18
          < X-Powered-By: PHP/7.0.18
          < Expires: Thu, 19 Nov 1981 08:52:00 GMT
          < Cache-Control: no-store, no-cache, must-revalidate
          < Pragma: no-cache
          < Set-Cookie: OBSID=pvp2v8q9g616u05gv9ju0g1hfac75ebl; path=/; secure; HttpOnly
          < Content-Length: 15
          < Content-Type: text/html; charset=UTF-8
          <
          * Connection #0 to host obtest.fqdn.net left intact
          Unauthenticated
          [root@lnx01 ~]#
          

          kentbjoh Kent Johannessen added a comment - Guess this can be closed now with the api official - Nice work   Would it be possible to add some debug ? API not working for me using curl, but no problem using a browser. Always getting unauthenticated no matter what. [root @lnx01 ~]# curl -k -v -u api:api https: //obtest.fqdn.net/api/v0/devices/debug * About to connect() to obtest.fqdn.net port 443 (# 0 ) *   Trying 10.10 . 134.75 ... * Connected to obtest.fqdn.net ( 10.10 . 134.75 ) port 443 (# 0 ) * Initializing NSS with certpath: sql:/etc/pki/nssdb * skipping SSL peer certificate verification * SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: *       subject: CN=obtest.fqdn.net *       start date: Mar 10 10 : 40 : 47 2016 GMT *       expire date: Mar 10 10 : 40 : 47 2018 GMT *       common name: obtest.fqdn.net *       issuer: * Server auth using Basic with user 'api' > GET /api/v0/devices/debug HTTP/ 1.1 > Authorization: Basic YXBpOmFwaQ== > User-Agent: curl/ 7.29 . 0 > Host: obtest.fqdn.net > Accept: */* > < HTTP/ 1.1 401 Unauthorized < Date: Fri, 12 May 2017 10 : 31 : 39 GMT < Server: Apache/ 2.4 . 6 (CentOS) OpenSSL/ 1.0 .1e-fips PHP/ 7.0 . 18 < X-Powered-By: PHP/ 7.0 . 18 < Expires: Thu, 19 Nov 1981 08 : 52 : 00 GMT < Cache-Control: no-store, no-cache, must-revalidate < Pragma: no-cache < Set-Cookie: OBSID=pvp2v8q9g616u05gv9ju0g1hfac75ebl; path=/; secure; HttpOnly < Content-Length: 15 < Content-Type: text/html; charset=UTF- 8 < * Connection # 0 to host obtest.fqdn.net left intact Unauthenticated [root @lnx01 ~]#

          Any chance of these fixes being included until a new API is in place ?

          kentbjoh Kent Johannessen added a comment - Any chance of these fixes being included until a new API is in place ?
          landy Mike Stupalov made changes -
          Workflow Original: classic default workflow [ 12640 ] New: Observium workflow [ 13139 ]

          Framework isn't really important. Flight seemed like the least hassle when I started, though slim was nice too.

          I was feeling like we should dump 90% of whatever framework we used, though.

          adama Adam Armstrong added a comment - Framework isn't really important. Flight seemed like the least hassle when I started, though slim was nice too. I was feeling like we should dump 90% of whatever framework we used, though.

          Cool, will be waiting Still flight framework ?

          kentbjoh Kent Johannessen added a comment - Cool, will be waiting Still flight framework ?

          I work on improve new API, I will update code soon, when finish some other tasks.

          landy Mike Stupalov added a comment - I work on improve new API, I will update code soon, when finish some other tasks.
          landy Mike Stupalov made changes -
          Assignee Original: Adam Armstrong [ adama ] New: Mike Stupalov [ landy ]

          People

            landy Mike Stupalov
            kentbjoh Kent Johannessen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: