Page 1 of 1

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

Posted: Wednesday 18 October 2017 20:52
by Feddan
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?

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

Posted: Thursday 19 October 2017 13:42
by Feddan
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"