JSON-RPC Schnittstelle unter Symcon 5.0

Hallo,

ich bin relativ neu was Symcon angeht und Frage mich wie ich die JSON-RPC Schnittstelle ansprechen kann. Laut Doku sieht ein Aufruf so aus:

$rpc = new JSONRPC("http://user:password@127.0.0.1:3777/api/");
$result = $rpc->IPS_GetKernelVersion();
echo "KernelVersion: ".$result;

Nur wo bekomme ich die JSONRPC Klasse her? In einem alten Forenbeitrag wurde mal geschrieben das diese im Scripts Ordner zu finden ist, dort ist aber nur eine leere __generated.inc.php und sonst nichts. Wäre schön wenn mir jemand einen Tipp geben könnte :slight_smile:

Du solltest dort auch ganz sicher eine __rpc.inc.php haben :slight_smile:

paresy

Nein da ist keine solche Datei.

scripts.jpg

Schau mal bitte im …/share/symcon/scripts Ordner nach.

paresy

Der Ordner existiert nicht. Es gibt unter Docker einen /opt/symcon/data und /opt/symcon/log Ordner. Mehr Volumes werden beim starten ja auch nicht erstellt.

Ich habe dir die Datei mal angehängt. Wenn du Docker nutzt, müsstest du die Datei aus dem Docker Container rauskopieren, da diese ja Bestandteil von IP-Symcon ist und nicht zu deinen „User“-Skripten gehört.

paresy

__rpc.inc.zip (1.51 KB)

Danke. Ich hatte mir Symcon gestern noch direkt unter Ubuntu installiert und von dort die Datei kopiert. Ich glaube es wäre hilfreich wenn in der Doku direkt auf die Datei verlinkt werden würde.

1 „Gefällt mir“

@paresy Wo findet man denn die __rpc.inc.php ? Ist der Pfad irgendwo dokumentiert?

Auf welchem OS bist du denn unterwegs bzw. was möchtest du machen?

Unter Linux findest du es unter /usr/share/symcon/scripts/

paresy

Hi @paresy
ich bin auf DOCKER unterwegs. Wenn ich da das mache:

sudo ls -al /var/lib/docker/volumes/symcon/_data/scripts/

Dann bekomme ich „nur“:

drwxr-xr-x  3 root root  4096 Jun 17 12:54 .
drwxr-xr-x 10 root root  4096 Aug 20  2024 ..
-rw-r--r--  1 root root   238 Jan 13 22:03 11387.ips.php
-rw-r--r--  1 root root  8038 Dec 30 22:15 14444.ips.json
-rw-r--r--  1 root root  2882 Apr 14 13:02 16648.ips.php
-rw-r--r--  1 root root 23490 Dec 30 22:22 18446.ips.json
-rw-r--r--  1 root root   167 Feb 20 22:17 18688.ips.php
-rw-r--r--  1 root root 23490 Dec 30 20:59 19336.ips.json
-rw-r--r--  1 root root 23490 Dec 30 21:09 21672.ips.json
-rw-r--r--  1 root root 34788 Feb 25 14:52 21723.ips.json
-rw-r--r--  1 root root  4520 Dec 31 12:30 22186.ips.json
-rw-r--r--  1 root root   167 Nov 14  2024 23131.ips.php
-rw-r--r--  1 root root  7239 Jan  2 07:28 24385.ips.json
-rw-r--r--  1 root root 12106 Dec 30 22:12 25379.ips.json
-rw-r--r--  1 root root  8038 Dec 30 21:19 25467.ips.json
-rw-r--r--  1 root root  8038 Dec 30 22:01 25625.ips.json
-rw-r--r--  1 root root 23491 Dec 30 22:35 28828.ips.json
-rw-r--r--  1 root root   167 Dec 26 18:23 29532.ips.php
-rw-r--r--  1 root root 23593 Mar 31 20:34 29597.ips.json
-rw-r--r--  1 root root  3681 Mar 25 13:26 31871.ips.php
-rw-r--r--  1 root root 22493 Dec 16  2024 32039.ips.json
-rw-r--r--  1 root root  8038 Dec 30 20:55 34197.ips.json
-rw-r--r--  1 root root  8038 Dec 30 22:53 36462.ips.json
-rw-r--r--  1 root root    50 Jan 13 21:35 36721.ips.php
-rw-r--r--  1 root root   238 Apr 10 15:12 36856.ips.php
-rw-r--r--  1 root root  8038 Dec 30 22:58 39587.ips.json
-rw-r--r--  1 root root 36102 Dec 17 21:30 41035.ips.json
-rw-r--r--  1 root root   167 Dec 26 17:14 41588.ips.php
-rw-r--r--  1 root root  8038 Dec 30 21:46 43128.ips.json
-rw-r--r--  1 root root  8038 Dec 30 22:50 43323.ips.json
-rw-r--r--  1 root root  4355 Dec 30 23:58 43677.ips.json
-rw-r--r--  1 root root  1281 Dec 31 13:07 43808.ips.php
-rw-r--r--  1 root root  8038 Dec 30 23:46 45964.ips.json
-rw-r--r--  1 root root  8038 Dec 30 22:57 46697.ips.json
-rw-r--r--  1 root root   167 Apr 10 15:03 48248.ips.php
-rw-r--r--  1 root root  2829 Dec 30 23:45 49482.ips.json
-rw-r--r--  1 root root 10123 Dec 31 13:10 50464.ips.json
-rw-r--r--  1 root root  3723 Feb 25 14:43 50689.ips.php
-rw-r--r--  1 root root  8038 Dec 30 21:51 51007.ips.json
-rw-r--r--  1 root root  2199 Dec 30 23:48 51980.ips.json
-rw-r--r--  1 root root   167 Mar 25 09:51 53552.ips.php
-rw-r--r--  1 root root   167 Nov 14  2024 54781.ips.php
-rw-r--r--  1 root root 12106 Dec 30 23:43 55178.ips.json
-rw-r--r--  1 root root 12106 Dec 30 22:03 55513.ips.json
-rw-r--r--  1 root root  2826 Apr 14 13:01 56758.ips.php
-rw-r--r--  1 root root 34685 Jun 17 12:54 __generated.inc.php
drwxr-xr-x  2 root root  4096 May 26 21:02 deleted

Die Datei ist auch nicht in Data, sondern nur im Container drin in dem von mir o.g. Pfad :slight_smile:

paresy

1 „Gefällt mir“

:bulb: Danke, damit komm ich weiter.

1 „Gefällt mir“