View previous topic :: View next topic |
Author |
Message |
totte
Joined: 30 May 2007 Posts: 54
|
Posted: Tue Nov 30, 2021 1:41 am Post subject: http request with åäö variables |
|
|
Hi
Trying to make an http request from an alertprofile when it sends åäö characters from some variables
Depending on what variable is used å is either Ã¥ (%folder%) and ? in %fvar_variable%
This is what is sent
{
"message": "Sk?netrafiken/%fvar_servername%/Skånetrafiken/Ping: fel",
"description": "",
"alias": "56156",
"priority": "P1",
"details": {
"Application": "Skånetrafiken",
"Server": "%fvar_servername%",
"Customer": "Sk?netrafiken",
"Reply": "",
"Status": "Unknown host",
"Recurrences": "4",
"RelatedUrl": "",
"CreateErrand": "https://pts.hogia.se/h2h/?HLTemplate=Incident&TID=56156#page1"
},
"tags": [
"Sk?netrafiken",
"Skånetrafiken",
"%fvar_servername%"
] |
|
Back to top |
|
 |
KS-Soft
Joined: 03 Apr 2002 Posts: 12649 Location: USA
|
Posted: Tue Nov 30, 2021 7:04 am Post subject: |
|
|
HostMonitor version?
Please provide complete HTTP header - HostMonitor may use different encoding rules depending on specified content-type and other parameters
Regards
Alex |
|
Back to top |
|
 |
totte
Joined: 30 May 2007 Posts: 54
|
Posted: Wed Dec 01, 2021 2:01 am Post subject: complete post |
|
|
Hi here is the complete message
POST https://api.eu.opsgenie.com/v2/alerts
Host: api.eu.opsgenie.com
Content-Type: application/json
Authorization: xxxxx-xxxx-xxx-xxx-xxxxxx
{
"message": "%fvar_custname%/%fvar_servername%/%fvar_appdesc%%Folder%/%testname%",
"description": "%commentline1%",
"alias": "%testid%",
"priority": "P1",
"details": {
"Application": "%fvar_appdesc%%Folder%",
"Server": "%fvar_servername%",
"Customer":"%fvar_custname%",
"Reply": "%reply%",
"Status": "%status%",
"Recurrences": "%Recurrences%",
"RelatedUrl": "%RelatedUrl%",
"CreateErrand": "https://xyz.se/h2h/?HLTemplate=Incident&TID=%testid%#page1"
},
"tags": [
"%fvar_custname%",
"%fvar_appdesc%%Folder%",
"%fvar_servername%"
]
} |
|
Back to top |
|
 |
KS-Soft
Joined: 03 Apr 2002 Posts: 12649 Location: USA
|
Posted: Wed Dec 01, 2021 7:07 am Post subject: |
|
|
HostMonitor version?
Quote: | ? in %fvar_variable% |
We can correct this.
If you are using latest version ( 12.98 ), please contact support @ks-soft.net, we will provide update.
Quote: | å is either Ã¥ (%folder%) |
Looks like that's how system or web server or browser encodes-decodes Unicode->UTF8->Unicode.
Is that wrong (å <> Ã¥)?
Regards
Alex |
|
Back to top |
|
 |
KS-Soft
Joined: 03 Apr 2002 Posts: 12649 Location: USA
|
Posted: Wed Dec 01, 2021 11:15 am Post subject: |
|
|
PS
We cannot reproduce problem related to å character. May be your web server does not translate UTF8 correctly?
Or may be there are some other characters that look the same...
Regards
Alex |
|
Back to top |
|
 |
totte
Joined: 30 May 2007 Posts: 54
|
Posted: Thu Dec 02, 2021 3:32 am Post subject: Hi |
|
|
I would like to have it translated to å if possible
the ? character make the webapi return bad request. Ã¥ is not translated but dosen´t return bad request
the weird part is that i "message" %folder% is translated to å but in "application" it is returned as Ã¥ |
|
Back to top |
|
 |
totte
Joined: 30 May 2007 Posts: 54
|
Posted: Thu Dec 02, 2021 3:46 am Post subject: hm version |
|
|
Hi
we are using version 12.99c version of hostmonitor |
|
Back to top |
|
 |
KS-Soft
Joined: 03 Apr 2002 Posts: 12649 Location: USA
|
Posted: Thu Dec 02, 2021 3:51 am Post subject: |
|
|
Quote: | the ? character make the webapi return bad request. |
As I said we can correct this, please contact support, we will provide update.
Quote: | the weird part is that i "message" %folder% is translated to å but in "application" it is returned as Ã¥ |
What exactly application?
We think its not HostMonitor problem.
Regards
Alex |
|
Back to top |
|
 |
totte
Joined: 30 May 2007 Posts: 54
|
Posted: Thu Dec 02, 2021 4:25 am Post subject: application |
|
|
Have sent to support
I´m trying to send to Opsgenie API. But when verifiying I´m using https://webhook.site
both returns %folder% varible å the same way. |
|
Back to top |
|
 |
|