ssh or http request with zoneminder

hi

i’m trying change status of zoneminder with my veralite, but is it possible with lua?

ubuntu server 10.04 only zoneminder (php,ssh,…) is run (no samba, curl, …): 192.168.1.120
192.168.1.120/zm/index.php?view=watch&mid1 for webcam
192.168.1.120/zm/index.php?view=watch&mid2 for foscam

i’ve tried :

1)with identification on zoneminder

luup.inet.wget("http://192.168.1.120/zm/index.php?view=watch&mid1&newFunction=Modect&newEnabled=1&user=xxxxxx&pass=xxxxxx") : no change
2)without identification on zoneminder

luup.inet.wget("http://192.168.1.120/zm/index.php?view=watch&mid1&newFunction=Modect&newEnabled=1") : no change
3)

[code]local http = require(“socket.http”)

– 5 Second timeout
http.TIMEOUT = 5

– The return parameters are in a different order from luup.inet.wget(…)
result, status = http.request(“http://login:motdepasse@192.168.1.120/zm/index.php?view=watch&mid1&newFunction=Modect&newEnabled=1”)[/code]

no change

  1. with ssh?

os.execute("ssh user@192.168.1.120 & sudo zmpkg.pl surveillance") no change

so is it possible or not at all?

thank for your attention

This works for me:

[code]local http = require(“socket.http”)
local ltn12 = require(“ltn12”)

local response_body = {}
local request_body = “view=none&action=function&mid=1&newFunction=Monitor&newEnabled=1”

local body, code, headers, status = http.request{
url = “http://192.168.1.65/zm/index.php/”,
method = “POST”,
headers = {
[“Accept”] = “/”,
[“Content-Length”] = string.len(request_body),
[“Content-Type”] = “application/x-www-form-urlencoded”
},
source = ltn12.source.string(request_body),
sink = ltn12.sink.table(response_body)
}[/code]