Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-3798

Add device via API and set specific poller_id

Details

    • Help
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • API
    • Observium 21.6.11399

      1x Observium Web / Poller instance (Ubuntu Server 16.04.7 LTS)
      1x Observium DB instance (Ubuntu Server 18.04.5 LTS | MySQL 5.7.34)
      1x Observium Poller instance (Ubuntu Server 20.04.2 LTS)

    Description

      Hello,

      I am trying to add devices to Observium using API.

      I also want to pass the corresponding poller_id, because we have 2x Observium Poller in our environment.

      I saw in the official documentation that this is possible, but it doesn't work for me.

      The device can be added, but no matter what poller ID I specify, it is ignored, the device is added and has poller_id 0 / default configured.

      My call looks something like this.

      curl -u <USER>:<PASSWORD> https://<OBSERVIUM_DNS_NAME>/api/v0/devices/ -H "Content-Type: application/json" -X POST -d '{"hostname":"<DEVICE_DNS_NAME>", "snmp_community":"<SNMP_COMMUNITY_STRING>", "poller_id":"1"}'
      

      Where is my failure?

      Attachments

        Activity

          [OBS-3798] Add device via API and set specific poller_id

          The API doesn't (yet? who knows) have access to the remote pollers, so has to insert into a queue in the database for remote pollers to pick up. Didn't realise this was already added to the API!

          adama Adam Armstrong added a comment - The API doesn't (yet? who knows) have access to the remote pollers, so has to insert into a queue in the database for remote pollers to pick up. Didn't realise this was already added to the API!

          Hello,

          you are right. I had overread that.

          The output was as follows:

          {"status":"ok","action_id":true,"message":"Device with hostname <DNS-NAME> added to queue [2] for addition on remote Poller [1]
          

           

          And after about 5 minutes it was then visible in the UI with the defined poller.

          Thank you very much.

          mknorr Markus Knorr added a comment - Hello, you are right. I had overread that. The output was as follows: { "status" : "ok" , "action_id" : true , "message" :"Device with hostname <DNS-NAME> added to queue [ 2 ] for addition on remote Poller [ 1 ]   And after about 5 minutes it was then visible in the UI with the defined poller. Thank you very much.

          Please note, for remote pollers device not directly added to db, but added to poller queue.
          After that discovery new on remote poller will try to addition this device.
          (About failed/success will written eventlog message)

          landy Mike Stupalov added a comment - Please note, for remote pollers device not directly added to db, but added to poller queue. After that discovery new on remote poller will try to addition this device. (About failed/success will written eventlog message)

          Wait, but this ability was already added in r11286.

          Please show output from curl request

          landy Mike Stupalov added a comment - Wait, but this ability was already added in r11286. Please show output from curl request

          will do

          landy Mike Stupalov added a comment - will do

          Ahh, at present this can only be done via the UI. The API doesn't yet know about the poller_id field.

          adama Adam Armstrong added a comment - Ahh, at present this can only be done via the UI. The API doesn't yet know about the poller_id field.

          People

            landy Mike Stupalov
            mknorr Markus Knorr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: