Monitor memory usage - curl command results in "401 Unauthorized"

All kinds of 'OS' scripts
Post Reply
Feddan
Posts: 7
Joined: Wednesday 18 October 2017 16:04
Target OS: -
Domoticz version:
Contact:

Monitor memory usage - curl command results in "401 Unauthorized"

Post by Feddan » Wednesday 18 October 2017 20:52

I'm trying to follow this guide:
https://www.domoticz.com/wiki/Monitor_memory_usage

It didn't work but after replacing "grep telegram-cli" with "grep domoticz" I at least got it to print out the current memory usage in the terminal. But when I execute the following command:

Code: Select all

curl "http://192.168.1.243:8080/json.htm?type=command&param=udevice&idx=128&nvalue=0&svalue=2.5"
I get:
<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>


Any ideas what I've done wrong?

Feddan
Posts: 7
Joined: Wednesday 18 October 2017 16:04
Target OS: -
Domoticz version:
Contact:

Re: Monitor memory usage - curl command results in "401 Unauthorized"

Post by Feddan » Thursday 19 October 2017 13:42

I solved it by adding &username=AAA&password=BBB
where AAA is the encoded username and BBB is the encoded password. I used this webpage to encode them: https://www.base64encode.org/

More information regarding this is available here: https://www.domoticz.com/wiki/Domoticz_ ... horization

So this is the updated command (Username and Password have been changed):

Code: Select all

curl "http://192.168.1.243:8080/json.htm?username=ZG9ua2V5&password=ZnVja2Vy&type=command&param=udevice&idx=128&nvalue=0&svalue=0"

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests