Announcement

Collapse
No announcement yet.

Method not found error.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Method not found error.

    Hi,

    I have successfully get an authentication from Centreon.

    curl -s --data 'username=user&password=*****' 'http://localhost/centreon/api/index.php?action=authenticate'

    but I am not able to get hosts status due to "Method not found " error

    curl -s 'http://localhost/centreon/api/index.php?object=centreon_realtime_hosts&action=li st' -H 'Content-Type: application/json' -H 'centreon-auth-token: ######################'

    "Method not found"

    Does anyone have encountered same problem, please let me know.
    Thank you very much!!!!

    PS. I already give a permission the user "reach API", and access all lists.

  • #2
    Hello,

    There is no space for the action keyword "action=li st" , so the command is like this
    Code:
    curl -s 'http://localhost/centreon/api/index.php?object=centreon_realtime_hosts&action=list' -H 'Content-Type: application/json' -H 'centreon-auth-token: NWE4ODFmMjFlZWIwNTcuMzczMTI4ODY='
    Part of the result
    Code:
    [{"id":"23","name":"Central","alias":"Serveur de supervision","address":"localhost","state":"0","state_type":"1","output":"OK - localhost: rta 0,040ms, lost 0%","max_check_attempts":"2","check_attempt":"1","last_check":"1518870139","last_state_change":"1517850519","last_hard_state_change":"1517850519","acknowledged":"0","instance_name":"Central","criticality":"1"},{"id":"24","name":"vmtechpoller","alias":"poller","ad.....
    What is the version of the Centreon-web ?
    Visiter mon site perso http://eric.coquard.free.fr/atelier/

    Comment


    • #3
      too bad we can not even filter by STATUS as explained in the documentation... very sad

      GET /centreon/api/index.php?action=list&object=centreon_realtime_ser vices&viewType=problems&fields=host_name,state,out put&status=critical HTTP/1.1


      HTTP/1.1 400 Bad Request

      ________________________________________
      CentOS 5.5 x64 / Nagios 3.2.2 / Centreon 2.1.10
      Monitoring: 467 Hosts / 2109Services 16th Server
      NdoUtils 1.49,NagiosPlugins 1.4.14, NagVis 1.5.1, Distributed Architeture(howto)

      Nagios/Centreon Custom Scripts / Troubleshooting
      www.felipeferreira.net

      Comment

      Working...
      X