blob: fd2c248b720c458600a3d29965389801d8b31742 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<?php
function sendflux($data) {
$url = 'http://10.222.42.54:8086/write?db=freifunk';
$options = array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode("{{ influx_user }}:{{ influx_password }}") ."\r\nContent-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => $data,
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
}
?>
|