KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

http request with åäö variables

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
totte



Joined: 30 May 2007
Posts: 55

PostPosted: Tue Nov 30, 2021 1:41 am    Post subject: http request with åäö variables Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12790
Location: USA

PostPosted: Tue Nov 30, 2021 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
totte



Joined: 30 May 2007
Posts: 55

PostPosted: Wed Dec 01, 2021 2:01 am    Post subject: complete post Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12790
Location: USA

PostPosted: Wed Dec 01, 2021 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 12790
Location: USA

PostPosted: Wed Dec 01, 2021 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
totte



Joined: 30 May 2007
Posts: 55

PostPosted: Thu Dec 02, 2021 3:32 am    Post subject: Hi Reply with quote

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
View user's profile Send private message
totte



Joined: 30 May 2007
Posts: 55

PostPosted: Thu Dec 02, 2021 3:46 am    Post subject: hm version Reply with quote

Hi

we are using version 12.99c version of hostmonitor
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12790
Location: USA

PostPosted: Thu Dec 02, 2021 3:51 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
totte



Joined: 30 May 2007
Posts: 55

PostPosted: Thu Dec 02, 2021 4:25 am    Post subject: application Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index