Skip to content
Permalink
Browse files
Improvet verbosity.
  • Loading branch information
Uladzislau Dadzimau committed Jul 6, 2020
1 parent 92c41f5 commit 00ea9e387ff20917da18dfd3724b254424705bcc
Showing 2 changed files with 3 additions and 1 deletion.
@@ -4,4 +4,4 @@
*/imports/
*/logs/
/development/azure.json
/development/zabbix-azure-010.zip
/development/zabbix-azure-*.zip
@@ -50,6 +50,7 @@ function Set-ZaAzureMonitorZabbixHostItemValue {
$itemLastValue = Get-ZaZabbixItemHistory -auth $zabbixToken -url $zabbixUrl -itemId $zabbixHostItem.itemid;
if ($itemLastValue)
{
Write-Verbose "Latest timestamp for the item: $($itemLastValue[0].clock).";
$startTime = $($itemLastValue[0].clock | ConvertTo-DateTime).ToString("yyyy-MM-ddTHH:mm:ssZ");
}
else
@@ -58,6 +59,7 @@ function Set-ZaAzureMonitorZabbixHostItemValue {
$startTime = $(Get-Date).ToUniversalTime().AddDays(-3).ToString("yyyy-MM-ddTHH:mm:ssZ");
}

Write-Verbose "Current Epoch time (-3 minutes): $($(Get-Date).AddMinutes(-3).ToUniversalTime() | ConvertTo-EpochTime)."
$now = $(Get-Date).AddMinutes(-3).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ");
Write-Verbose "Timespan = '$startTime - $now'.";
# /Getting time span to be used in Azure Monitor query

0 comments on commit 00ea9e3

Please sign in to comment.