pushdata webapi
-
Hi,
How can i use curl to push dci data on remote netxms host?
From changelog i see push dci via webapi feature is already implemented (even if it's not documented), but i always get 404 Not Found -> error 46
I also put debug to 6, but i get no log about webapi.This is an example:
/usr/bin/curl -u admin:XXXXXX -H "Accept: application/json" -H "Content-Type:application/json" --data '{"login":"admin", "password":"XXXXX","data": {"node",1234,"OK" }}' -v "http://x.x.x.x:8080/webapi/pushData"
> User-Agent: curl/7.64.0
> Accept: application/json
> Content-Type:application/json
> Content-Length: 41
>
* upload completely sent off: 41 out of 41 bytes
< HTTP/1.1 404 Not Found
< Content-Type: application/json;charset=utf-8
< Date: Fri, 26 Aug 2022 10:25:21 GMT
< Accept-Ranges: none
< Server: Restlet-Framework/2.4.3
< Content-Length: 43
<
* Connection #0 to host X.X.X.X left intact
{"description":"Internal error","error":46} -
There are two options - to send value for a single DCI or for a number of DCIs (array is used in this case);
One value:
{ nodeId : 10, dciId : 20, value : "Value" }Or, alternatively node name and DCI name (parameter name) can be used:
{ nodeName : "Node name", dciName : "DCI name", value : "Value" }When sending multiple values:
data : [ { nodeId : 10, dciId : 20, value : "Value" }, { nodeName : "Node name", dciName : "DCI name", value : "Value" } ] -
Thanks, it's now clear how to send value but unfortunately i still cannot authenticate the POST with the netxms api.
I also tried with the sessesionhandler cookie as explained here:
https://wiki.netxms.org/wiki/Web_service_API
In my case, i've no proxy in front of it, and with the jetty requestlog i don't see any error except "internal error" .
I'm authenticating with the "admin" user (full rights).
Is there something that i missing to enable? -
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