Hello dear Observium Team,I'm trying to add a device using the API and get an error 500 message instead of the expected notice that the device is not respondig to snmp.
> curl -u korten:secret https://observium.domain.net/api/v0/devices/ -X POST -d '{"hostname":"pe-lab02.domain.net", "snmp_community":"test", "ping_skip":"on"}'
<h1>500 Internal Server Error</h1><h3>flight\Engine::_json(): Argument #2 ($code) must be of type int, string given, called in /opt/observium/libs/flight3/core/Dispatcher.php on line 86 (0)</h3><pre>#0 /opt/observium/libs/flight3/core/Dispatcher.php(86): flight\Engine->_json() #1 /opt/observium/libs/flight3/core/Dispatcher.php(50): flight\core\Dispatcher->runEvent() #2 /opt/observium/libs/flight3/Engine.php(113): flight\core\Dispatcher->run()
#3 [internal function]: flight\Engine->__call()#4 /opt/observium/libs/flight3/core/Dispatcher.php(287): call_user_func_array() #5 /opt/observium/libs/flight3/Flight.php(143): flight\core\Dispatcher::invokeMethod() #6 /opt/observium/html/api/v0/includes/devices.inc.php(133): Flight::__callStatic()
#7 [internal function]: api_add_device()#8 /opt/observium/libs/flight3/core/Dispatcher.php(250): call_user_func_array() #9 /opt/observium/libs/flight3/core/Dispatcher.php(237): flight\core\Dispatcher::callFunction() #10 /opt/observium/libs/flight3/Engine.php(508): flight\core\Dispatcher::execute() #11 /opt/observium/libs/flight3/core/Dispatcher.php(86): flight\Engine->_start() #12 /opt/observium/libs/flight3/core/Dispatcher.php(50): flight\core\Dispatcher->runEvent() #13 /opt/observium/libs/flight3/Engine.php(113): flight\core\Dispatcher->run()
#14 [internal function]: flight\Engine->__call()#15 /opt/observium/libs/flight3/core/Dispatcher.php(287): call_user_func_array() #16 /opt/observium/libs/flight3/Flight.php(143): flight\core\Dispatcher::invokeMethod()
#17 /opt/observium/html/api/v0/index.php(66): Flight::__callStatic() #18 {main}</pre> As far as I can see, the error is in: api/v0/includes/devices.inc.php at line 133: >Flight::json($json, '400'); should be: Flight::json($json, 400); Agree? Thank you and have a nice day, Nico -- Nicolas Korten Dipl.-Ing. Systemtechnik und Dienste/EDV komro GmbH Am Innreit 2 DE-83022 Rosenheim Telefon: +49 8031 365 7913 Telefax: +49 8031 365 7699 Mail: kor...@komro.net / http://www.komro.net __________________________________________________________________________________________________________ Geschäftsführer: Dipl. Ing. Gert Vorwalder Vorsitz im Aufsichtsrat: Oberbürgermeister Andreas März Sitz der Gesellschaft: Rosenheim Registergericht: Traunstein, HRB-Nr. 10689 USt.-IdNr.: DE 188814299 Hinweise zur Verarbeitung Ihrer personenbezogenen Daten gem Art. 13 DSGVO:Verantwortlich für die Verarbeitung Ihrer personenbezogenen Daten im Rahmen des vorliegenden Kontakts ist die komro GmbH Weitere Informationen zur Verarbeitung Ihrer Daten, insbesondere zu den Ihnen zustehenden Rechten, können Sie unserer Homepage unter https://www.komro.net/datenschutz entnehmen oder auf jedem anderen Wege unter den o.g. Kontaktdaten bei uns erfragen.
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ observium mailing list -- observium@lists.observium.org To unsubscribe send an email to observium-le...@lists.observium.org