1 |
daniel-marschall |
8 |
#!/usr/bin/php |
2 |
|
|
<?php |
3 |
|
|
|
4 |
|
|
# --- PLEASE MODIFY: |
5 |
|
|
|
6 |
|
|
# To which daemon server should the alarm be sent? |
7 |
|
|
$url = "http://127.0.0.1:8085"; |
8 |
|
|
|
9 |
|
|
# --- DON'T MODIFY AFTER THIS LINE |
10 |
|
|
|
11 |
|
|
$fields = array(); |
12 |
|
|
$fields[] = "action=motion_on"; // 1.3.6.1.4.1.37476.2.4.1.100 |
13 |
|
|
|
14 |
|
|
$fields_string = implode('&', $fields); |
15 |
|
|
|
16 |
|
|
echo urldecode($fields_string)."\n"; |
17 |
|
|
|
18 |
|
|
$ch = curl_init(); |
19 |
|
|
curl_setopt($ch, CURLOPT_URL, $url); |
20 |
|
|
curl_setopt($ch, CURLOPT_POST, true); |
21 |
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); |
22 |
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
23 |
|
|
|
24 |
|
|
$result = curl_exec($ch); |
25 |
|
|
|
26 |
|
|
echo $result; |