Reapply "Add aggregate Veeam jobs summary item"
This reverts commit c8b6f4d31b.
This commit is contained in:
@@ -506,6 +506,31 @@ function Format-VeeamJobDetailsTable {
|
||||
return ($lines -join [Environment]::NewLine)
|
||||
}
|
||||
|
||||
function Format-VeeamJobsSummary {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[object[]]$JobDetails
|
||||
)
|
||||
|
||||
if ($JobDetails.Count -eq 0) {
|
||||
return 'No Veeam jobs found'
|
||||
}
|
||||
|
||||
$lines = @('Job | Enabled | Last run | Next run | Result | Restore points')
|
||||
|
||||
foreach ($job in ($JobDetails | Sort-Object -Property name)) {
|
||||
$lines += ('{0} | {1} | {2} | {3} | {4} | {5}' -f
|
||||
$job.name,
|
||||
$job.enabled_text,
|
||||
$job.last_run,
|
||||
$job.next_run,
|
||||
$job.result,
|
||||
$job.restore_points_text)
|
||||
}
|
||||
|
||||
return ($lines -join [Environment]::NewLine)
|
||||
}
|
||||
|
||||
function Format-ZabbixSenderValue {
|
||||
param(
|
||||
[object]$Value
|
||||
@@ -644,6 +669,7 @@ function Get-VeeamJobMetrics {
|
||||
error_names = Format-ZabbixTextValue -Values @($errorJobs | ForEach-Object { Get-VeeamJobName -Job $_ })
|
||||
warning_names = Format-ZabbixTextValue -Values @($warningJobs | ForEach-Object { Get-VeeamJobName -Job $_ })
|
||||
jobs_table = Format-VeeamJobDetailsTable -JobDetails $jobDetails
|
||||
jobs_summary = Format-VeeamJobsSummary -JobDetails $jobDetails
|
||||
jobs_lld = [ordered]@{
|
||||
data = $jobsLld
|
||||
}
|
||||
@@ -711,6 +737,7 @@ function Send-ZabbixMetrics {
|
||||
"`"$ZabbixHost`" veeam.jobs.error.names $(Format-ZabbixSenderValue -Value $Metrics.error_names)"
|
||||
"`"$ZabbixHost`" veeam.jobs.warning.names $(Format-ZabbixSenderValue -Value $Metrics.warning_names)"
|
||||
"`"$ZabbixHost`" veeam.jobs.table $(Format-ZabbixSenderValue -Value $Metrics.jobs_table)"
|
||||
"`"$ZabbixHost`" veeam.jobs.summary $(Format-ZabbixSenderValue -Value $Metrics.jobs_summary)"
|
||||
) | Set-Content -Path $senderInput -Encoding ASCII
|
||||
|
||||
$failedEndpoints = @()
|
||||
|
||||
14
README.md
14
README.md
@@ -22,6 +22,7 @@ This repository contains PowerShell scripts for Veeam Backup & Replication:
|
||||
"error_names": "Failed job",
|
||||
"warning_names": "Warning job",
|
||||
"jobs_table": "Name | Enabled | Last run | Next run | Result | Restore points\n...",
|
||||
"jobs_summary": "Job | Enabled | Last run | Next run | Result | Restore points\nDaily backup | yes | 2026-07-16 01:00:00 | 2026-07-17 01:00:00 | Success | 14",
|
||||
"jobs_lld": {
|
||||
"data": [
|
||||
{
|
||||
@@ -79,6 +80,17 @@ 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.
|
||||
|
||||
If dashboard widgets cannot render discovered items as a table, use this single
|
||||
aggregate item instead:
|
||||
|
||||
```text
|
||||
Veeam: Jobs summary
|
||||
veeam.jobs.summary
|
||||
```
|
||||
|
||||
It contains all jobs in one multiline value and is the most compatible dashboard
|
||||
option for Zabbix 7.0.
|
||||
|
||||
For a compact dashboard list, use the discovered summary item:
|
||||
|
||||
```text
|
||||
@@ -105,7 +117,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 | Item value or item history | `veeam.jobs.summary` |
|
||||
| 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` |
|
||||
|
||||
@@ -364,6 +364,34 @@
|
||||
</tag>
|
||||
</tags>
|
||||
</item>
|
||||
<item>
|
||||
<uuid>a1fd086f2f2a46179d01636953e8a82d</uuid>
|
||||
<name>Veeam: Jobs summary</name>
|
||||
<type>DEPENDENT</type>
|
||||
<key>veeam.jobs.summary</key>
|
||||
<delay>0</delay>
|
||||
<master_item>
|
||||
<key>veeam.scripts.monitor</key>
|
||||
</master_item>
|
||||
<value_type>TEXT</value_type>
|
||||
<description>Dashboard-friendly multiline summary with all Veeam jobs.</description>
|
||||
<preprocessing>
|
||||
<step>
|
||||
<type>JSONPATH</type>
|
||||
<parameters>
|
||||
<parameter>$.jobs_summary</parameter>
|
||||
</parameters>
|
||||
</step>
|
||||
</preprocessing>
|
||||
<history>90d</history>
|
||||
<trends>0</trends>
|
||||
<tags>
|
||||
<tag>
|
||||
<tag>component</tag>
|
||||
<value>backup</value>
|
||||
</tag>
|
||||
</tags>
|
||||
</item>
|
||||
</items>
|
||||
<discovery_rules>
|
||||
<discovery_rule>
|
||||
|
||||
Reference in New Issue
Block a user