diff --git a/zbx-smart.ps1 b/zbx-smart.ps1 index dd3310f..c34603e 100755 --- a/zbx-smart.ps1 +++ b/zbx-smart.ps1 @@ -178,7 +178,7 @@ function Send-SmartDiscoToZabbix { $disco = Get-SmartDisco $jsons=$disco | ConvertTo-Json -Compress - zabbix_sender -vv -k "8o_smartcheck.disco_devs" -o '$jsons' -c /etc/zabbix/zabbix_agentd.conf + zabbix_sender -vv -k "8o_smartcheck.disco_devs" -o '$jsons' -c /etc/zabbix/zabbix_agentd.conf | logger -t zbx_smart } @@ -197,22 +197,22 @@ function Send-SmartInfosToZabbix { Write-Output "- 8o_smartcheck.[${dn}.power_cycle_count] $($dev.PowerCycleCount)" Write-Output "- 8o_smartcheck.[${dn}.temperature] $($dev.Temperature)" } - } | zabbix_sender -vv -i - -c /etc/zabbix/zabbix_agentd.conf + } | zabbix_sender -vv -i - -c /etc/zabbix/zabbix_agentd.conf | logger -t zbx-smart } $exitcode=0 if ( $smart_disco ) { - Write-Output "Doing SMART-Disco " + Write-Output "Doing SMART-Disco " | logger -s -t zbx-smart Send-SmartDiscoToZabbix } if ( $smart_check ) { - Write-Output "Doing SMART-Check withExternal: ${smart_with_external} " + Write-Output "Doing SMART-Check withExternal: ${smart_with_external} " | logger -s -t zbx-smart Send-SmartInfosToZabbix -withExternalDevs $smart_with_external } -Write-Output "Done" +Write-Output "Done" | logger -s -t zbx-smart exit $exitcode