mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Fix inclusion of Manufacturer and Model in telemetry data. Add timezone.
This commit is contained in:
@@ -144,6 +144,7 @@ sub collectData {
|
||||
my $dbh = shift;
|
||||
my $telemetry = shift;
|
||||
$telemetry->{uuid} = getUUID($dbh);
|
||||
$telemetry->{timezone} = $Config{ZM_TIMEZONE};
|
||||
@$telemetry{qw(city region country latitude longitude)} = getGeo();
|
||||
$telemetry->{timestamp} = strftime('%Y-%m-%dT%H:%M:%S%z', localtime());
|
||||
$telemetry->{monitor_count} = countQuery($dbh, 'Monitors');
|
||||
@@ -192,7 +193,7 @@ sub sendData {
|
||||
$ua->proxy('https', $Config{ZM_UPDATE_CHECK_PROXY});
|
||||
}
|
||||
|
||||
Debug("Posting telemetry data to: $server_endpoint");
|
||||
Debug("Posting telemetry data $msg to: $server_endpoint");
|
||||
|
||||
# set custom HTTP request header fields
|
||||
my $req = HTTP::Request->new(POST => $server_endpoint);
|
||||
@@ -290,8 +291,8 @@ sub getMonitorRef {
|
||||
my $dbh = shift;
|
||||
|
||||
my $sql = 'SELECT `Id`,`Name`,`Type`,`Capturing`,`Analysing`,`Recording`,`Width`,`Height`,`Colours`,`MaxFPS`,`AlarmMaxFPS`,
|
||||
(SELECT Name FROM Manufacturers WHERE Manufacturers.Id = ManufacturerId),
|
||||
(SELECT Name FROM Models WHERE Models.Id = ModelId)
|
||||
(SELECT Name FROM Manufacturers WHERE Manufacturers.Id = ManufacturerId) AS Manufacturer,
|
||||
(SELECT Name FROM Models WHERE Models.Id = ModelId) AS Model
|
||||
FROM `Monitors`';
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
|
||||
|
||||
Reference in New Issue
Block a user