Skip to content

Syntax error in WeatherMapDataSource_zabbix.php: line 50 #1

@ghost

Description

Good day.
I found a syntax error in WeatherMapDataSource_zabbix.php, line 50.
When trying to run ./weathermap with included zabbix datasource plugin it returns:
PHP Parse error: syntax error, unexpected '[' in /tmp/weathermap/lib/datasources/WeatherMapDataSource_zabbix.php on line 50

$in_value = $this->zabbixApi->getItemLastValue($host,$zabbix_key, $in)['lastvalue'];
$raw_out_value = $this->zabbixApi->getItemLastValue($host, $zabbix_key, $out);
$out_value = $raw_out_value["lastvalue"];

Looks like it was fixed for out_value, but not for in.
Worked variant:

$in_value = $this->zabbixApi->getItemLastValue($host,$zabbix_key, $in)['lastvalue'];

$raw_out_value = $this->zabbixApi->getItemLastValue($host, $zabbix_key, $out);
$raw_in_value = $this->zabbixApi->getItemLastValue($host, $zabbix_key, $in);
$in_value = $raw_in_value["lastvalue"];
$out_value = $raw_out_value["lastvalue"];
$data_time = $raw_out_value["lastclock"];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions