Revert "Add Veeam job summary item prototype"
This reverts commit 6b2c6c6392.
This commit is contained in:
@@ -242,27 +242,6 @@ function ConvertTo-ZabbixText {
|
||||
return $text
|
||||
}
|
||||
|
||||
function Format-VeeamJobSummary {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Enabled,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$LastRun,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$NextRun,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Result,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$RestorePoints
|
||||
)
|
||||
|
||||
return 'Enabled: {0} | Last: {1} | Next: {2} | Result: {3} | Restore points: {4}' -f $Enabled, $LastRun, $NextRun, $Result, $RestorePoints
|
||||
}
|
||||
|
||||
function Get-VeeamJobScheduleEnabled {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
@@ -552,33 +531,24 @@ function Get-VeeamJobMetrics {
|
||||
$lastState = Get-VeeamJobLastState -Job $_ -LastSession $lastSession
|
||||
$restorePoints = $null
|
||||
$enabledNumeric = if ($scheduleEnabled -eq $false) { 0 } else { 1 }
|
||||
$enabledText = if ($enabledNumeric -eq 1) { 'yes' } else { 'no' }
|
||||
$lastRunText = ConvertTo-ZabbixText -Value (Get-VeeamJobLastRun -Job $_ -LastSession $lastSession)
|
||||
$nextRunText = ConvertTo-ZabbixText -Value (Get-VeeamJobNextRun -Job $_)
|
||||
$lastResultText = ConvertTo-ZabbixText -Value $lastResult
|
||||
$lastStateText = ConvertTo-ZabbixText -Value $lastState
|
||||
$resultText = ConvertTo-ZabbixText -Value $(if ($null -ne $lastResult) { $lastResult } else { $lastState })
|
||||
|
||||
if ($restorePointCounts.ContainsKey($jobName)) {
|
||||
$restorePoints = $restorePointCounts[$jobName]
|
||||
}
|
||||
|
||||
$restorePointsText = ConvertTo-ZabbixText -Value $restorePoints
|
||||
|
||||
[ordered]@{
|
||||
key = ConvertTo-ZabbixJobKey -Name $jobName
|
||||
name = $jobName
|
||||
enabled = $scheduleEnabled
|
||||
enabled_numeric = $enabledNumeric
|
||||
enabled_text = $enabledText
|
||||
last_run = $lastRunText
|
||||
next_run = $nextRunText
|
||||
last_result = $lastResultText
|
||||
last_state = $lastStateText
|
||||
result = $resultText
|
||||
enabled_text = if ($enabledNumeric -eq 1) { 'yes' } else { 'no' }
|
||||
last_run = ConvertTo-ZabbixText -Value (Get-VeeamJobLastRun -Job $_ -LastSession $lastSession)
|
||||
next_run = ConvertTo-ZabbixText -Value (Get-VeeamJobNextRun -Job $_)
|
||||
last_result = ConvertTo-ZabbixText -Value $lastResult
|
||||
last_state = ConvertTo-ZabbixText -Value $lastState
|
||||
result = ConvertTo-ZabbixText -Value $(if ($null -ne $lastResult) { $lastResult } else { $lastState })
|
||||
restore_points = $restorePoints
|
||||
restore_points_text = $restorePointsText
|
||||
summary = Format-VeeamJobSummary -Enabled $enabledText -LastRun $lastRunText -NextRun $nextRunText -Result $resultText -RestorePoints $restorePointsText
|
||||
restore_points_text = ConvertTo-ZabbixText -Value $restorePoints
|
||||
}
|
||||
})
|
||||
$disabledJobs = @($allJobs | Where-Object {
|
||||
|
||||
18
README.md
18
README.md
@@ -43,8 +43,7 @@ This repository contains PowerShell scripts for Veeam Backup & Replication:
|
||||
"last_state": "Stopped",
|
||||
"result": "Success",
|
||||
"restore_points": 14,
|
||||
"restore_points_text": "14",
|
||||
"summary": "Enabled: yes | Last: 2026-07-16 01:00:00 | Next: 2026-07-17 01:00:00 | Result: Success | Restore points: 14"
|
||||
"restore_points_text": "14"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -71,7 +70,6 @@ veeam.job.last_run[{#VEEAMJOBKEY}]
|
||||
veeam.job.next_run[{#VEEAMJOBKEY}]
|
||||
veeam.job.result[{#VEEAMJOBKEY}]
|
||||
veeam.job.restore_points[{#VEEAMJOBKEY}]
|
||||
veeam.job.summary[{#VEEAMJOBKEY}]
|
||||
```
|
||||
|
||||
`{#VEEAMJOBNAME}` is stored as a tag named `veeam_job`, so Zabbix views and
|
||||
@@ -79,18 +77,6 @@ dashboard widgets can group or filter the discovered items by job name. The
|
||||
legacy `veeam.jobs.table` item remains available as a quick text overview, but
|
||||
the discovered items are the preferred way to build a dashboard.
|
||||
|
||||
For a compact dashboard list, use the discovered summary item:
|
||||
|
||||
```text
|
||||
Veeam job [JOB_NAME]: Summary
|
||||
```
|
||||
|
||||
It displays one line per job:
|
||||
|
||||
```text
|
||||
Enabled: yes | Last: 2026-07-16 01:00:00 | Next: - | Result: Success | Restore points: 14
|
||||
```
|
||||
|
||||
## Zabbix dashboard idea
|
||||
|
||||
Create a dashboard named `Veeam Jobs` for hosts linked to the `Veeam Backup Jobs`
|
||||
@@ -105,7 +91,7 @@ Suggested widgets:
|
||||
| Top row | Item value | `veeam.jobs.disabled` |
|
||||
| Top row | Item value | `veeam.jobs.error` |
|
||||
| Top row | Item value | `veeam.jobs.warning` |
|
||||
| Middle | Item list | discovered `Veeam job [*]: Summary` items |
|
||||
| Middle | Top hosts or item list | discovered `veeam.job.*` items |
|
||||
| Bottom left | Item value or item list | `veeam.jobs.error.names` |
|
||||
| Bottom center | Item value or item list | `veeam.jobs.warning.names` |
|
||||
| Bottom right | Item value or item list | `veeam.jobs.disabled.names` |
|
||||
|
||||
@@ -537,38 +537,6 @@
|
||||
</tag>
|
||||
</tags>
|
||||
</item_prototype>
|
||||
<item_prototype>
|
||||
<uuid>db766a0ea9984a988cb49c5bb6a029b4</uuid>
|
||||
<name>Veeam job [{#VEEAMJOBNAME}]: Summary</name>
|
||||
<type>DEPENDENT</type>
|
||||
<key>veeam.job.summary[{#VEEAMJOBKEY}]</key>
|
||||
<delay>0</delay>
|
||||
<master_item>
|
||||
<key>veeam.scripts.monitor</key>
|
||||
</master_item>
|
||||
<value_type>TEXT</value_type>
|
||||
<description>Single-line summary for Veeam job {#VEEAMJOBNAME}: enabled state, last run, next run, latest result, and restore point count.</description>
|
||||
<preprocessing>
|
||||
<step>
|
||||
<type>JSONPATH</type>
|
||||
<parameters>
|
||||
<parameter>$.jobs[?(@.key=="{#VEEAMJOBKEY}")].summary.first()</parameter>
|
||||
</parameters>
|
||||
</step>
|
||||
</preprocessing>
|
||||
<history>90d</history>
|
||||
<trends>0</trends>
|
||||
<tags>
|
||||
<tag>
|
||||
<tag>component</tag>
|
||||
<value>backup</value>
|
||||
</tag>
|
||||
<tag>
|
||||
<tag>veeam_job</tag>
|
||||
<value>{#VEEAMJOBNAME}</value>
|
||||
</tag>
|
||||
</tags>
|
||||
</item_prototype>
|
||||
</item_prototypes>
|
||||
<preprocessing>
|
||||
<step>
|
||||
|
||||
Reference in New Issue
Block a user