Seite 1 von 1

Zeilenumbruch bei setHostNotes

Verfasst: 28 Okt 2020, 19:38
von islam
Hallo,

ich versuche mittels opsi-admin und opsiservicecall einen Zeilenumbruch in die Client Notizen einzufügen, was leider nicht klappt:

Code: Alles auswählen

opsi-admin -d method setHostNotes "host.fqdn" "AnyDesk ID: \n 1234"
leider bekomme ich damit keine neue Zeile, sondern ein escaptes "\n" in dem Feld

Das gleiche habe ich über opsiservicecall probiert:

Code: Alles auswählen

[opsiservicecall_setHostNotes]
"method":"setHostNotes"
"params":[
"%HostID%"
"AnyDesk ID: \n 1234"
]
Error: retrieveJSONObject --- opsi service problem ----> unexpected Result from webservice in retrieveJSONObject, number of lines: 0-> retrieveJSONObject:1: Stream read error
Error: JSON connection not established

Re: Zeilenumbruch bei setHostNotes

Verfasst: 28 Okt 2020, 21:00
von SisterOfMercy
Is there a way to request the host notes with opsi-admin? Set a note with multiple lines in configed and see what the JSON would look like?
Have you also tried it with \r? Just guessing here.

Re: Zeilenumbruch bei setHostNotes

Verfasst: 28 Okt 2020, 23:29
von islam
Thanks for your Reply.
SisterOfMercy hat geschrieben:Is there a way to request the host notes with opsi-admin? Set a note with multiple lines in configed and see what the JSON would look like?
already tried

Code: Alles auswählen

opsi-admin -d method host_getObjects [] '{"id":"host.fqdn"}' | grep "notes"
is gives for new lines. But when entered as set command it gets escaped and becomes when requested again
Have you also tried it with \r? Just guessing here.
yes, tried. also didn't work

Thanks