Compare commits
45 Commits
zabbix-age
...
master
Author | SHA1 | Date | |
---|---|---|---|
164cd8cb3b | |||
ff4a05ae59 | |||
c1e46207da | |||
f72910cc6b | |||
62b8de1b05 | |||
066f622888 | |||
12c8396be3 | |||
f7835e1b90 | |||
a5ad4081f0 | |||
00790af9bf | |||
55c878cf24 | |||
2cec18b4a5 | |||
1ddf903568 | |||
e5047e7b92 | |||
34d19c8622 | |||
2c29e4ecaa | |||
995bd50151 | |||
7b42d3f2a9 | |||
313e022894 | |||
3159f43ced | |||
b0958e6fba | |||
ed5c8b745f | |||
5acc49a55c | |||
7cfbd64eb4 | |||
221a0afe5d | |||
e0be2c506f | |||
4e50e2b2d4 | |||
f46a580f90 | |||
e0d2825f21 | |||
56fcaf7f6c | |||
5afabbfaad | |||
849170c10b | |||
31ccccd2e0 | |||
1950abbc0f | |||
51fa9f602a | |||
607204a150 | |||
5e7e22d311 | |||
80bfaee714 | |||
8140dcb7cf | |||
820d12a682 | |||
2d88e6fe34 | |||
cd48caa24c | |||
7c42540a66 | |||
a24f4adb81 | |||
a73021a2d5 |
|
@ -1 +1 @@
|
|||
0.2.154-1 ./
|
||||
0.2.172-1 ./
|
||||
|
|
|
@ -36,6 +36,10 @@ sub list_smart_hdd{
|
|||
foreach my $line (@smart_info){
|
||||
if ($line =~ m/^SMART support is:\s+Enabled/i){
|
||||
$smart_enabled = 1;
|
||||
last;
|
||||
} elsif ($line =~ m/NVMe/i){
|
||||
$smart_enabled = 1;
|
||||
last;
|
||||
} elsif ($line =~ m/^Transport protocol:\s+iSCSI/i){
|
||||
# Skip iSCSI block
|
||||
next BLOCK;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Summary: Scripts for Zabbix monitoring
|
||||
Name: zabbix-agent-addons
|
||||
Version: 0.2.154
|
||||
Version: 0.2.172
|
||||
Release: 1%{?dist}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
@ -106,6 +106,69 @@ fi
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Dec 21 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.172-1
|
||||
- Add Zabbix template for storageDevices (dbd@ehtrace.com)
|
||||
- Read raw value for SSL_Life_Left (dbd@ehtrace.com)
|
||||
- Read SSD_Life_Left if available (dbd@ehtrace.com)
|
||||
- /dev/bus/0 might not exist but can be queried (dbd@ehtrace.com)
|
||||
- Report more info from some NVMe (dbd@ehtrace.com)
|
||||
- Adjust default values for stor dev (dbd@ehtrace.com)
|
||||
- Fix UserParam (dbd@ehtrace.com)
|
||||
- Add new script for smart monitoring (dbd@ehtrace.com)
|
||||
|
||||
* Tue Sep 19 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.171-1
|
||||
- Ignore samba NT_STATUS_PROTOCOL_UNREACHABLE errors (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jun 29 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.170-1
|
||||
- Fix + discover NMVe (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jun 29 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.169-1
|
||||
- Better sensor output parsing (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jun 29 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.168-1
|
||||
- Drop ipmitool stderr and simplify output parsing (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jun 29 2023 Daniel Berteaud <dbd@ehtrace.com> 0.2.167-1
|
||||
- Fix fan detection on some BMC boards (dbd@ehtrace.com)
|
||||
- Update ZFS template (dbd@ehtrace.com)
|
||||
|
||||
* Sat Mar 26 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.166-1
|
||||
- Fix counting samba computers auth tries (dbd@ehtrace.com)
|
||||
|
||||
* Mon Mar 21 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.165-1
|
||||
- last_seen might not be defined in check_unifi (dbd@ehtrace.com)
|
||||
|
||||
* Mon Mar 21 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.164-1
|
||||
- Use JSON bool in unifi scripts (dbd@ehtrace.com)
|
||||
|
||||
* Mon Jan 24 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.163-1
|
||||
- Fix check_zimbra_sudo (dbd@ehtrace.com)
|
||||
|
||||
* Fri Jan 21 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.162-1
|
||||
- Add alloc_ct for LVM VG when missing (dbd@ehtrace.com)
|
||||
|
||||
* Fri Jan 21 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.161-1
|
||||
- Fix Zimbra discovery and check scripts (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jan 20 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.160-1
|
||||
- Add a {#DOCKER_CONTAINER_STATUS} LLD macro (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jan 20 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.159-1
|
||||
- Update Docker template (dbd@ehtrace.com)
|
||||
- Don't query state in docker discovery (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jan 13 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.158-1
|
||||
- Small fixes for Docker check script and template (dbd@ehtrace.com)
|
||||
|
||||
* Thu Jan 13 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.157-1
|
||||
- Enhacements in the Docker template (dbd@ehtrace.com)
|
||||
|
||||
* Wed Jan 12 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.156-1
|
||||
- Add Docker scripts (dbd@ehtrace.com)
|
||||
|
||||
* Tue Jan 11 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.155-1
|
||||
- Release bump
|
||||
|
||||
* Thu Dec 16 2021 Daniel Berteaud <dani@lapiole.org> 0.2.154-1
|
||||
- Fix zpool iostat as /proc/spl/kstat/zfs/pool/io doesn't exist anymore
|
||||
(dani@lapiole.org)
|
||||
|
|
9
zabbix_conf/docker.conf
Normal file
9
zabbix_conf/docker.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Discover Docker items
|
||||
# $1 can be containers, networks, volumes
|
||||
UserParameter=container.docker.discovery[*],/usr/bin/sudo /var/lib/zabbix/bin/disco_docker_sudo --what $1
|
||||
|
||||
# Type: Agent or Agent (active)
|
||||
# container.docker.check.all[type,id]
|
||||
# Where type is what to monitor (global, container, network, volume)
|
||||
# id is the id of the item to monitor. Can be a name or an ID. For the global check, there's no ID
|
||||
UserParameter=container.docker.check[*],/usr/bin/sudo /var/lib/zabbix/bin/check_docker_sudo --$1 $2
|
|
@ -5,3 +5,7 @@ UserParameter=hardware.disk.smart.discovery,/usr/bin/sudo /var/lib/zabbix/bin/di
|
|||
# Takes two args: the drives to check, and the value to get
|
||||
# eg: hardward.disk.smart[/dev/sda,Reallocated_Sector_Ct]
|
||||
UserParameter=hardware.disk.smart[*],/usr/bin/sudo /var/lib/zabbix/bin/check_smart_sudo $1 $2
|
||||
|
||||
# New smart disk discovery/monitoring
|
||||
UserParameter=stor.dev.discovery[*],/usr/bin/sudo /var/lib/zabbix/bin/disco_stor_dev_sudo
|
||||
UserParameter=stor.dev.info[*],/usr/bin/sudo /var/lib/zabbix/bin/check_stor_dev_sudo --dev "$1" --type "$2"
|
||||
|
|
90
zabbix_scripts/check_docker_sudo
Executable file
90
zabbix_scripts/check_docker_sudo
Executable file
|
@ -0,0 +1,90 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use JSON;
|
||||
use Getopt::Long;
|
||||
use File::Which;
|
||||
use Date::Parse;
|
||||
|
||||
my $docker = which('docker');
|
||||
my $json = {};
|
||||
my $pretty = 0;
|
||||
my ($global, $container, $network, $volume) = undef;
|
||||
|
||||
GetOptions(
|
||||
'global' => \$global,
|
||||
'container=s' => \$container,
|
||||
'network=s' => \$network,
|
||||
'volume=s' => \$volume,
|
||||
'pretty' => \$pretty
|
||||
);
|
||||
|
||||
# Sanitize args
|
||||
if (defined $container and not $container =~ m/^[a-zA-Z0-9\-_]+/){
|
||||
die "Invalid container ID $container\n";
|
||||
} elsif (defined $network and not $network =~ m/^[a-zA-Z0-9\-_]+/){
|
||||
die "Invalid network ID\n";
|
||||
} elsif (defined $volume and not $volume =~ m/^[a-zA-Z0-9\-_]+/){
|
||||
die "Invalid volume name\n";
|
||||
}
|
||||
|
||||
# Default formating
|
||||
my $format = '{{ json . }}';
|
||||
my $cmd;
|
||||
if ($global){
|
||||
$json->{info} = from_json(qx($docker info --format '$format'));
|
||||
} elsif (defined $container) {
|
||||
$json->{inspect} = from_json(qx($docker container inspect $container --format '$format'));
|
||||
$json->{stats} = from_json(qx($docker container stats $container --format '$format' --no-stream));
|
||||
# Remove percent sign so Zabbix can get raw value
|
||||
foreach my $stat (qw(MemPerc CPUPerc)){
|
||||
$json->{stats}->{$stat} =~ s/%$//;
|
||||
}
|
||||
# Extract mem usage vs mem limit, net in vs net out and blk read vs blk write
|
||||
($json->{stats}->{MemCurrent}, $json->{stats}->{MemLimit}) = split(/\s*\/\s*/, $json->{stats}->{MemUsage});
|
||||
($json->{stats}->{NetIOIn}, $json->{stats}->{NetIOOut}) = split(/\s*\/\s*/, $json->{stats}->{NetIO});
|
||||
($json->{stats}->{BlockIORead}, $json->{stats}->{BlockIOWrite}) = split(/\s*\/\s*/, $json->{stats}->{BlockIO});
|
||||
# Convert into Bytes
|
||||
foreach my $stat (qw(MemCurrent MemLimit NetIOIn NetIOOut BlockIORead BlockIOWrite)){
|
||||
$json->{stats}->{$stat} = convert_unit($json->{stats}->{$stat});
|
||||
}
|
||||
# Compute a useful Uptime from the StartedAt value
|
||||
if ($json->{inspect}->{State}->{Running}){
|
||||
$json->{stats}->{Uptime} = int(time() - str2time($json->{inspect}->{State}->{StartedAt}));
|
||||
} else {
|
||||
$json->{stats}->{Uptime} = 0;
|
||||
}
|
||||
} elsif (defined $network){
|
||||
$json->{inspect} = from_json(qx($docker network inspect $network --format '$format'));
|
||||
} elsif (defined $volume){
|
||||
$json->{inspect} = from_json(qx($docker volume inspect $volume --format '$format'));
|
||||
}
|
||||
|
||||
print to_json($json, { pretty => $pretty }) . "\n";
|
||||
|
||||
|
||||
sub convert_unit {
|
||||
my $val = shift;
|
||||
my $suffix_multiplier = {
|
||||
ki => 1024,
|
||||
Ki => 1024,
|
||||
Mi => 1024 * 1024,
|
||||
Gi => 1024 * 1024 * 1024,
|
||||
Ti => 1024 * 1024 * 1024 * 1024,
|
||||
Pi => 1024 * 1024 * 1024 * 1024 * 1024,
|
||||
k => 1000,
|
||||
K => 1000,
|
||||
M => 1000 * 1000,
|
||||
G => 1000 * 1000 * 1000,
|
||||
T => 1000 * 1000 * 1000 * 1000,
|
||||
P => 1000 * 1000 * 1000 * 1000 * 1000
|
||||
};
|
||||
if ($val =~ m/^(\d+(\.\d+)?)(ki|Ki|Mi|Gi|Ti|Pi|k|K|M|G|T|P)?B/){
|
||||
$val = int($1 * $suffix_multiplier->{$3}) if (defined $3 and defined $suffix_multiplier->{$3});
|
||||
# Remove the Bytes suffix if remaining
|
||||
$val =~ s/B$//;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
|
@ -43,6 +43,10 @@ EOF
|
|||
my $json;
|
||||
if (defined $vg){
|
||||
%{$json} = get_volume_group_information($vg);
|
||||
# Depending on LVM version, alloc_ct might not be present
|
||||
if (not defined $json->{alloc_ct}){
|
||||
$json->{alloc_ct} = sprintf("%.1f", 100 * $json->{alloc_pe_size} / $json->{vg_size});
|
||||
}
|
||||
} elsif (defined $lv) {
|
||||
%{$json} = get_lv_info($lv);
|
||||
} else{
|
||||
|
|
|
@ -166,8 +166,12 @@ if (defined $ou){
|
|||
|
||||
my $subject;
|
||||
if ($type eq 'Authentication'){
|
||||
if ($event->{Authentication}->{status} eq 'NT_STATUS_PROTOCOL_UNREACHABLE'){
|
||||
# Ignore NT_STATUS_PROTOCOL_UNREACHABLE as they are harmless
|
||||
next;
|
||||
}
|
||||
# Accounts ending with $ are for computers
|
||||
$subject = (($event->{$type}->{mappedAccount} || $event->{$type}->{clientAccount} || '')=~ m/\$$/) ? 'computers' : 'users';
|
||||
$subject = (($event->{$type}->{mappedAccount} || $event->{$type}->{clientAccount} || '')=~ m/\$(\@.+)?$/) ? 'computers' : 'users';
|
||||
if ($event->{Authentication}->{status} eq 'NT_STATUS_OK'){
|
||||
$json->{activity}->{authentications}->{$subject}->{success}++;
|
||||
} else {
|
||||
|
|
120
zabbix_scripts/check_stor_dev_sudo
Normal file
120
zabbix_scripts/check_stor_dev_sudo
Normal file
|
@ -0,0 +1,120 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use JSON;
|
||||
use Getopt::Long;
|
||||
use File::Which;
|
||||
|
||||
my $dev = undef;
|
||||
my $type = 'auto';
|
||||
my $what = 'json';
|
||||
my $pretty = 0;
|
||||
|
||||
GetOptions(
|
||||
'device=s' => \$dev,
|
||||
'type=s' => \$type,
|
||||
'what=s' => \$what,
|
||||
'pretty' => \$pretty
|
||||
);
|
||||
|
||||
if (not defined $dev or $dev !~ m|^/dev/\w+(/\w+)*$|){
|
||||
print "Invalid --device\n";
|
||||
exit 1;
|
||||
} elsif ($what !~ m/^\w+$/){
|
||||
print "Invalid --what\n";
|
||||
exit 1;
|
||||
} elsif ($type !~ m/^\w+\+*\w+(,\w+)*$/){
|
||||
print "Invalid --type\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $json = {
|
||||
temperature_celsius => 25,
|
||||
power_on_hours => 0,
|
||||
power_cycle_count => 0,
|
||||
reallocated_sector_count => 0,
|
||||
current_pending_sector => 0,
|
||||
offline_uncorrectable => 0,
|
||||
percent_lifetime_remain => 100,
|
||||
firmware_version => 0
|
||||
};
|
||||
my $smartctl = which('smartctl');
|
||||
|
||||
sub print_out {
|
||||
if ($what eq 'json'){
|
||||
print to_json($json, { pretty => $pretty });
|
||||
exit 0;
|
||||
} elsif (defined $json->{$what}){
|
||||
print $json->{$what} . "\n";
|
||||
exit 0;
|
||||
} else {
|
||||
print "ZBX_NOTSUPPORTED\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub get_smart_attr {
|
||||
my $smart = shift;
|
||||
my $attr = shift;
|
||||
|
||||
if (defined $smart->{ata_smart_attributes}->{table}){
|
||||
foreach (@{$smart->{ata_smart_attributes}->{table}}){
|
||||
if ($_->{name} eq $attr){
|
||||
return $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
if (not defined $smartctl){
|
||||
$what = 'error';
|
||||
print_out();
|
||||
}
|
||||
|
||||
my $data = from_json(qx($smartctl -a $dev -d $type --json=c));
|
||||
|
||||
if (defined $data->{temperature}->{current}){
|
||||
$json->{temperature_celsius} = $data->{temperature}->{current};
|
||||
}
|
||||
|
||||
if (defined $data->{power_on_time}->{hours}){
|
||||
$json->{power_on_hours} = $data->{power_on_time}->{hours};
|
||||
}
|
||||
|
||||
if (defined $data->{power_cycle_count}){
|
||||
$json->{power_cycle_count} = $data->{power_cycle_count};
|
||||
}
|
||||
|
||||
if (defined $data->{firmware_version}){
|
||||
$json->{firmware_version} = $data->{firmware_version};
|
||||
}
|
||||
|
||||
my ($pending, $realloc, $offline, $remain);
|
||||
if ($pending = get_smart_attr($data, 'Current_Pending_Sector')){
|
||||
$json->{current_pending_sector} = $pending->{raw}->{value};
|
||||
}
|
||||
|
||||
if ($realloc = get_smart_attr($data, 'Reallocated_Sector_Ct') || get_smart_attr($data, 'Reallocated_Event_Count')){
|
||||
$json->{reallocated_sector_count} = $realloc->{raw}->{value};
|
||||
} elsif (defined $data->{nvme_smart_health_information_log}->{media_errors}){
|
||||
# NMVe can report media error, so report it as reallocated sectors
|
||||
$json->{reallocated_sector_count} = $data->{nvme_smart_health_information_log}->{media_errors};
|
||||
}
|
||||
|
||||
if ($offline = get_smart_attr($data, 'Offline_Uncorrectable')){
|
||||
$json->{offline_uncorrectable} = $offline->{raw}->{value};
|
||||
}
|
||||
|
||||
if ($remain = get_smart_attr($data, 'Percent_Lifetime_Remain')){
|
||||
$json->{percent_lifetime_remain} = $remain->{value};
|
||||
} elsif ($remain = get_smart_attr($data, 'SSD_Life_Left')){
|
||||
$json->{percent_lifetime_remain} = $remain->{raw}->{value};
|
||||
} elsif ($remain = get_smart_attr($data, 'Wear_Leveling_Count')){
|
||||
$json->{percent_lifetime_remain} = $remain->{value};
|
||||
} elsif (defined $data->{nvme_smart_health_information_log}->{percentage_used}){
|
||||
# NMVe sometime report the estimated life used, instead of the remaining
|
||||
$json->{percent_lifetime_remain} = 100 - $data->{nvme_smart_health_information_log}->{percentage_used};
|
||||
}
|
||||
print_out();
|
|
@ -136,7 +136,7 @@ if ($unifi){
|
|||
$json->{$_} = $obj->{$_} if (defined $obj->{$_});
|
||||
}
|
||||
# Convert last seen into a relative time
|
||||
$json->{last_seen} = time - $obj->{last_seen};
|
||||
$json->{last_seen} = (defined $obj->{last_seen}) ? time - $obj->{last_seen} : time;
|
||||
# Add some more info in sys_stats
|
||||
$json->{sys_stats}->{$_} = $obj->{'system-stats'}->{$_} foreach (qw/cpu mem uptime/);
|
||||
|
||||
|
@ -162,7 +162,7 @@ if ($unifi){
|
|||
}
|
||||
|
||||
foreach my $entry (@{from_json($resp->decoded_content)->{data}}){
|
||||
next if (not $entry->{ap_mac} or $entry->{ap_mac} ne $dev or $entry->{is_wired} == JSON::PP::true);
|
||||
next if (not $entry->{ap_mac} or $entry->{ap_mac} ne $dev or $entry->{is_wired} == JSON::true);
|
||||
foreach (@radio_proto){
|
||||
if ($entry->{radio_proto} eq $_){
|
||||
$json->{'num_sta_' . $_}++;
|
||||
|
@ -199,10 +199,10 @@ if ($unifi){
|
|||
$json->{$_} = $obj->{$_} || 0;
|
||||
}
|
||||
# Convert last_seen to relative
|
||||
$json->{last_seen} = time - $json->{last_seen};
|
||||
$json->{last_seen} = (defined $obj->{last_seen}) ? time - $obj->{last_seen} : time;
|
||||
|
||||
# For wireless stations, we gather some more info
|
||||
if ($obj->{is_wired} == JSON::PP::false){
|
||||
if ($obj->{is_wired} == JSON::false){
|
||||
my @client_wireless = qw/rx_rate tx_rate essid ap_mac tx_power radio_proto signal noise satisfaction/;
|
||||
foreach (@client_wireless){
|
||||
$json->{$_} = $obj->{$_} || 0;
|
||||
|
|
|
@ -45,8 +45,8 @@ my $output = {};
|
|||
|
||||
if (defined $status){
|
||||
foreach my $line (qx($zmcontrol status)){
|
||||
if ($line =~ m/^\s+(\w+)\s+(Running|Stopped)/){
|
||||
$output->{$1} = ($2 eq 'Running') ? 1 : 0;
|
||||
if ($line =~ m/^\s+(\w+)(\swebapp)?\s+(Running|Stopped)/){
|
||||
$output->{$1} = ($3 eq 'Running') ? 1 : 0;
|
||||
}
|
||||
}
|
||||
if ($status eq 'all'){
|
||||
|
|
68
zabbix_scripts/disco_docker_sudo
Executable file
68
zabbix_scripts/disco_docker_sudo
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use JSON;
|
||||
use Getopt::Long;
|
||||
use File::Which;
|
||||
use Data::Dumper;
|
||||
|
||||
my $what = 'containers';
|
||||
my $pretty = 0;
|
||||
|
||||
GetOptions(
|
||||
'what=s' => \$what,
|
||||
'pretty' => \$pretty
|
||||
);
|
||||
|
||||
my $json = [];
|
||||
|
||||
my $docker = which('docker');
|
||||
|
||||
# If the docker cli is not available, terminate now
|
||||
if (not defined $docker){
|
||||
print $json . "\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
my $format;
|
||||
my $cmd;
|
||||
if ($what =~ m/^containers?/){
|
||||
$format = '{' .
|
||||
'"{#DOCKER_CONTAINER_ID}":"{{ .ID }}",' .
|
||||
'"{#DOCKER_CONTAINER_IMAGE}": "{{ .Image }}",' .
|
||||
'"{#DOCKER_CONTAINER_NAME}":"{{ .Names }}",' .
|
||||
'"{#DOCKER_CONTAINER_STATUS}":"{{ .Status }}"' .
|
||||
'}';
|
||||
$cmd = "$docker container list --all --format '$format'";
|
||||
} elsif ($what =~ m/^networks?/){
|
||||
$format = '{' .
|
||||
'"{#DOCKER_NET_ID}":"{{ .ID }}",' .
|
||||
'"{#DOCKER_NET_NAME}":"{{ .Name }}",' .
|
||||
'"{#DOCKER_NET_DRIVER}":"{{ .Driver }}",' .
|
||||
'"{#DOCKER_NET_SCOPE}":"{{ .Scope }}"' .
|
||||
'}';
|
||||
$cmd = "$docker network list --format '$format'";
|
||||
} elsif ($what =~ m/^volumes?/){
|
||||
$format = '{' .
|
||||
'"{#DOCKER_VOL_NAME}":"{{ .Name }}",' .
|
||||
'"{#DOCKER_VOL_DRIVER}":"{{ .Driver }}",' .
|
||||
'"{#DOCKER_VOL_SCOPE}":"{{ .Scope }}"' .
|
||||
'}';
|
||||
$cmd = "$docker volume list --format '$format'";
|
||||
} else {
|
||||
print <<_EOF
|
||||
Usage: $0 --what=<item to discover> [--pretty]
|
||||
with available item being
|
||||
* containers : list containers, including stopped ones
|
||||
* networks : list networks
|
||||
* volumes : list volumes
|
||||
_EOF
|
||||
}
|
||||
|
||||
foreach my $line (qx($cmd)){
|
||||
chomp $line;
|
||||
push @{$json}, from_json($line);
|
||||
}
|
||||
print to_json($json, { pretty => $pretty }) . "\n";
|
||||
exit(0);
|
61
zabbix_scripts/disco_stor_dev_sudo
Normal file
61
zabbix_scripts/disco_stor_dev_sudo
Normal file
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use JSON;
|
||||
use Getopt::Long;
|
||||
use Data::Dumper;
|
||||
use File::Which;
|
||||
|
||||
my $pretty = 0;
|
||||
|
||||
GetOptions(
|
||||
'pretty' => \$pretty
|
||||
);
|
||||
|
||||
my $smartctl = which('smartctl');
|
||||
my $json = [];
|
||||
|
||||
sub print_out {
|
||||
print to_json($json, { pretty => $pretty });
|
||||
}
|
||||
|
||||
if (not defined $smartctl){
|
||||
print_out();
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $smart_scan = from_json(qx($smartctl --scan-open --json=c));
|
||||
|
||||
if (not defined $smart_scan){
|
||||
print_out();
|
||||
exit 0;
|
||||
}
|
||||
|
||||
foreach my $device (@{$smart_scan->{devices}}){
|
||||
my ($model, $sn, $has_smart) = "";
|
||||
my $smart_info = from_json(qx($smartctl -i $device->{name} -d $device->{type} --json=c));
|
||||
|
||||
if (defined $smart_info){
|
||||
$model = $smart_info->{model_name};
|
||||
$sn = $smart_info->{serial_number};
|
||||
$has_smart = (
|
||||
$smart_info->{in_smartctl_database} or (
|
||||
defined $smart_info->{smart_support} and
|
||||
$smart_info->{smart_support}->{available} and
|
||||
$smart_info->{smart_support}->{enabled}
|
||||
)
|
||||
) ? 1 : 0;
|
||||
}
|
||||
|
||||
push @{$json}, {
|
||||
'{#STOR_DEV_NAME}' => $device->{name},
|
||||
'{#STOR_DEV_DESC}' => $device->{info_name},
|
||||
'{#STOR_DEV_TYPE}' => $device->{type},
|
||||
'{#STOR_DEV_PROTO}' => $device->{protocol},
|
||||
'{#STOR_DEV_MODEL}' => $model,
|
||||
'{#STOR_DEV_SN}' => $sn,
|
||||
'{#STOR_DEV_SMART}' => int $has_smart
|
||||
};
|
||||
}
|
||||
|
||||
print_out();
|
|
@ -107,8 +107,8 @@ if ($what eq 'devices'){
|
|||
foreach my $entry (@{from_json($resp->decoded_content)->{data}}){
|
||||
# Ignore other sites
|
||||
next if ($entry->{site_id} ne $site_id);
|
||||
next if ($type eq 'wireless' and $entry->{is_wired} eq 'true');
|
||||
next if ($type eq 'wired' and $entry->{is_wired} eq 'false');
|
||||
next if ($type eq 'wireless' and $entry->{is_wired} == JSON::true);
|
||||
next if ($type eq 'wired' and $entry->{is_wired} == JSON::false);
|
||||
push @{$json->{data}}, {
|
||||
'{#UNIFI_STA_ID}' => $entry->{_id},
|
||||
'{#UNIFI_STA_NAME}' => (defined $entry->{hostname}) ? $entry->{hostname} : $entry->{mac},
|
||||
|
|
|
@ -6,8 +6,7 @@ use Getopt::Long;
|
|||
use Net::Domain qw(hostfqdn);
|
||||
use Data::Dumper;
|
||||
|
||||
my $json;
|
||||
@{$json->{data}} = ();
|
||||
my $json = [];
|
||||
|
||||
my $pretty = 0;
|
||||
my $services = 1;
|
||||
|
@ -47,7 +46,7 @@ if ($services){
|
|||
};
|
||||
foreach my $service (qx($zmprov getServer $hostname zimbraServiceEnabled)){
|
||||
if ($service =~ m/^zimbraServiceEnabled:\s+(\w+)/){
|
||||
push @{$json->{data}}, {
|
||||
push @{$json}, {
|
||||
'{#ZM_SERVICE}' => $1
|
||||
};
|
||||
}
|
||||
|
@ -55,7 +54,7 @@ if ($services){
|
|||
} elsif ($servers){
|
||||
foreach my $server (qx($zmprov getAllServers)){
|
||||
chomp $server;
|
||||
push @{$json->{data}}, {
|
||||
push @{$json}, {
|
||||
'{#ZM_SERVER}' => $server
|
||||
};
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ my $sensors = {};
|
|||
# Try to detect IPMI sensors
|
||||
if ($ipmitool && -x $ipmitool){
|
||||
# First check for temperature sensors
|
||||
my @lines = qx($ipmitool sdr type Temperature);
|
||||
my @lines = qx($ipmitool sdr type Temperature 2>/dev/null);
|
||||
if ($? == 0){
|
||||
SENSOR: foreach my $l (@lines){
|
||||
chomp $l;
|
||||
|
@ -84,7 +84,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
my $name = $1;
|
||||
my $sensor = {};
|
||||
|
||||
my @details = qx($ipmitool sdr get '$name');
|
||||
my @details = qx($ipmitool sdr get '$name' 2>/dev/null);
|
||||
if ($? != 0){
|
||||
print "Couldn't get detail for sensor $name\n";
|
||||
next SENSOR;
|
||||
|
@ -124,7 +124,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
$sensor->{description} = $name;
|
||||
$sensor->{type} = 'temp';
|
||||
$sensor->{unit} = '°C';
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' | grep 'Sensor Reading' | awk '{print \$4}' | head -1";
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' 2>/dev/null | perl -ne 'if (/Sensor Reading\\s*:\\s*([^\\s]+)/) { print \"\$1\\n\"; last }'";
|
||||
my $id = sensor_name($name);
|
||||
$sensors->{$id} = $sensor;
|
||||
print "Found a temperature sensor using IPMI: $name\n";
|
||||
|
@ -133,7 +133,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
# Now check for Fan, nearly the same as Temp, but
|
||||
# * We try to detect the unit
|
||||
# * threshold handling is not the same
|
||||
@lines = qx($ipmitool sdr type Fan);
|
||||
@lines = qx($ipmitool sdr type Fan 2>/dev/null);
|
||||
if ($? == 0){
|
||||
SENSOR: foreach my $l (@lines){
|
||||
chomp $l;
|
||||
|
@ -144,7 +144,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
my $value = $3;
|
||||
my $sensor = {};
|
||||
|
||||
my @details = qx($ipmitool sdr get '$name');
|
||||
my @details = qx($ipmitool sdr get '$name' 2>/dev/null);
|
||||
if ($? != 0){
|
||||
print "Couldn't get detail for sensor $name\n";
|
||||
next SENSOR;
|
||||
|
@ -152,9 +152,9 @@ if ($ipmitool && -x $ipmitool){
|
|||
my $val = undef;
|
||||
foreach my $d (@details){
|
||||
chomp $d;
|
||||
if ($d =~ m/^\s*Sensor\sReading\s*:\s*(\w+)/){
|
||||
if ($d =~ m/^\s*Sensor\sReading\s*:\s*(\d+(\.\d+)?)/){
|
||||
$val = $1;
|
||||
if ($val !~ m/^\d+$/){
|
||||
if ($val !~ m/^\d+(\.\d+)?$/){
|
||||
print "Skipping sensor $name, couldn't parse its value: $val\n";
|
||||
next SENSOR;
|
||||
}
|
||||
|
@ -174,14 +174,14 @@ if ($ipmitool && -x $ipmitool){
|
|||
$sensor->{description} = $name;
|
||||
$sensor->{type} = 'fan';
|
||||
$sensor->{unit} = ($value =~ m/percent|%/ || $val < 100) ? '%' : 'rpm';
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' | grep 'Sensor Reading' | awk '{print \$4}' | head -1";
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' 2>/dev/null | perl -ne 'if (/Sensor Reading\\s*:\\s*([^\\s]+)/) { print \"\$1\\n\"; last }'";
|
||||
my $id = sensor_name($name);
|
||||
$sensors->{$id} = $sensor;
|
||||
print "Found a fan sensor using IPMI: $name\n";
|
||||
}
|
||||
}
|
||||
# Now look for power information
|
||||
@lines = qx($ipmitool sdr type 'Current');
|
||||
@lines = qx($ipmitool sdr type 'Current' 2>/dev/null);
|
||||
if ($? == 0){
|
||||
SENSOR: foreach my $l (@lines){
|
||||
chomp $l;
|
||||
|
@ -193,7 +193,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
my $value = $4;
|
||||
my $sensor = {};
|
||||
if ($name =~ m/(Power)|(Pwr)|(Consumption)|(PS\d+\sCurr\sOut)/i || $value =~ m/W(att)?/i){
|
||||
my @details = qx($ipmitool sdr get '$name');
|
||||
my @details = qx($ipmitool sdr get '$name' 2>/dev/null);
|
||||
if ($? != 0){
|
||||
print "Couldn't get detail for sensor $name\n";
|
||||
next SENSOR;
|
||||
|
@ -224,7 +224,7 @@ if ($ipmitool && -x $ipmitool){
|
|||
$sensor->{description} = $name;
|
||||
$sensor->{type} = 'power';
|
||||
$sensor->{unit} = ($name =~ m/%/) ? '%' : 'Watt';
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' | grep 'Sensor Reading' | awk '{print \$4}' | head -1";
|
||||
$sensor->{cmd} = "$ipmitool sdr get '$name' 2>/dev/null | perl -ne 'if (/Sensor Reading\\s*:\\s*([^\\s]+)/) { print \"\$1\\n\"; last }'";
|
||||
my $id = sensor_name($name);
|
||||
$sensors->{$id} = $sensor;
|
||||
print "Found a power sensor using IPMI: $name\n";
|
||||
|
@ -276,7 +276,7 @@ if ($lmsensor && -x $lmsensor){
|
|||
$sensor->{description} = $name;
|
||||
$sensor->{type} = 'temp';
|
||||
$sensor->{unit} = '°C';
|
||||
$sensor->{cmd} = "$lmsensor | grep '$name:' | cut -d+ -f2 | cut -d. -f1 | head -1";
|
||||
$sensor->{cmd} = "$lmsensor | perl -ne 'if (/^$name:\\s*\\+(\\d+)/) { print \"\$1\\n\"; last }'";
|
||||
my $id = sensor_name($name);
|
||||
$sensors->{$id} = $sensor;
|
||||
print "Found a temperature sensor using lm_sensors: $name\n";
|
||||
|
@ -297,7 +297,7 @@ if ($smartctl && -x $smartctl){
|
|||
threshold_high => $def_hd_temp_thres_high,
|
||||
type => 'temp',
|
||||
unit => '°C',
|
||||
cmd => "$smartctl -A /dev/$block | grep $1 | awk '{print \$10}'"
|
||||
cmd => "$smartctl -A /dev/$block | perl -ne 'if (/Temperature_Celsius(\\s+[^\\s]+){7}\\s+(\\d+(\\.\\d+)?)/) { print \"\$2\\n\"; last }'"
|
||||
};
|
||||
print "Found a temperature sensor using smartctl: $block\n";
|
||||
last;
|
||||
|
@ -310,7 +310,7 @@ if ($smartctl && -x $smartctl){
|
|||
threshold_high => $def_hd_temp_thres_high,
|
||||
type => 'temp',
|
||||
unit => '°C',
|
||||
cmd => "$smartctl -A /dev/$block | grep Temperature: | awk '{ print \$2 }'"
|
||||
cmd => "$smartctl -A /dev/$block | perl -ne 'if (/Temperature:\\s+(\\d+(\\.\\d+)?)/) { print \"\$1\\n\"; last }'"
|
||||
};
|
||||
print "Found a temperature sensor using smartctl: $block\n";
|
||||
last;
|
||||
|
@ -343,7 +343,7 @@ if ($smartctl && -x $smartctl){
|
|||
threshold_high => $def_hd_temp_thres_high,
|
||||
type => 'temp',
|
||||
unit => '°C',
|
||||
cmd => "$smartctl -A -d megaraid,$i /dev/sda | grep $1 | awk '{print \$10}'"
|
||||
cmd => "$smartctl -A -d megaraid,$i /dev/sda | perl -ne 'if (/(Temperature_Celsius|Airflow_Temperature_Cel)(\\s+[^\\s]+){7}\\s+(\\d+)/) { print \"\$3\\n\"; last }'"
|
||||
};
|
||||
print "Found a temperature sensor using smartctl (megaraid): sda-$i\n";
|
||||
last;
|
||||
|
|
610
zabbix_templates/Template_App_Docker.yaml
Normal file
610
zabbix_templates/Template_App_Docker.yaml
Normal file
|
@ -0,0 +1,610 @@
|
|||
zabbix_export:
|
||||
version: '5.4'
|
||||
date: '2022-01-20T13:55:05Z'
|
||||
groups:
|
||||
-
|
||||
uuid: 7df96b18c230490a9a0a9e2307226338
|
||||
name: Templates
|
||||
templates:
|
||||
-
|
||||
uuid: 722c34dae28f471b992685f75b217e84
|
||||
template: Template_App_Docker
|
||||
name: Template_App_Docker
|
||||
groups:
|
||||
-
|
||||
name: Templates
|
||||
items:
|
||||
-
|
||||
uuid: b35116a368e94b0698951010ddb496b5
|
||||
name: 'Docker: Number of paused container'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,ContainersPaused]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: '!container(s)'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.ContainersPaused
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
-
|
||||
uuid: ff406b09a49f42ef80e004f7b8737c9b
|
||||
name: 'Docker: Number of running container'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,ContainersRunning]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: '!container(s)'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.ContainersRunning
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
triggers:
|
||||
-
|
||||
uuid: 85e456243c714349b34ff6504d122004
|
||||
expression: 'change(/Template_App_Docker/container.docker.check[global,ContainersRunning])=1'
|
||||
name: 'Number of running containers changed to {ITEM.LASTVALUE1}'
|
||||
priority: INFO
|
||||
-
|
||||
uuid: 69c12d97c6604c608fba4d2c0d4875bb
|
||||
name: 'Docker: Number of stopped container'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,ContainersStopped]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: '!container(s)'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.ContainersStopped
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
-
|
||||
uuid: c6831879964a4a3a90fc82530e6a0d43
|
||||
name: 'Docker: Number of containers'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,Containers]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: '!container(s)'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.Containers
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
-
|
||||
uuid: 1da51785c3d34faf8ba7ab17d0b46b38
|
||||
name: 'Docker: Live restore status'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,LiveRestoreEnabled]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.LiveRestoreEnabled
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
triggers:
|
||||
-
|
||||
uuid: 85a2fc38a6bb42e183de3d4687f466e8
|
||||
expression: 'last(/Template_App_Docker/container.docker.check[global,LiveRestoreEnabled])<>"true" and {$DOCKER_WARN_NO_LIVE_RESTORE}=1'
|
||||
name: 'Docker live restore isn''t enabled'
|
||||
priority: WARNING
|
||||
-
|
||||
uuid: ab2d3bd636964a21b764b2f33f2e109e
|
||||
name: 'Docker: server version'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[global,ServerVersion]'
|
||||
delay: '0'
|
||||
history: 15d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.info.ServerVersion
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[global]'
|
||||
triggers:
|
||||
-
|
||||
uuid: 8c535ff0d73240c395226ee91a8096c4
|
||||
expression: '(last(/Template_App_Docker/container.docker.check[global,ServerVersion])<>last(/Template_App_Docker/container.docker.check[global,ServerVersion],#2))=1'
|
||||
name: 'Docker version changed ({ITEM.LASTVALUE1})'
|
||||
priority: WARNING
|
||||
-
|
||||
uuid: d5c424dc767c4a5ea1ee441e76770411
|
||||
name: 'Docker global info'
|
||||
key: 'container.docker.check[global]'
|
||||
delay: 5m
|
||||
history: '0'
|
||||
trends: '0'
|
||||
value_type: TEXT
|
||||
discovery_rules:
|
||||
-
|
||||
uuid: e459f638e15f495db3e4a9060e60f7c8
|
||||
name: 'Docker: container discovery'
|
||||
key: 'container.docker.discovery[containers]'
|
||||
delay: 15m
|
||||
lifetime: 7d
|
||||
item_prototypes:
|
||||
-
|
||||
uuid: 7f3fddee7aed48c8acc26e9aa98df298
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Disk IO Read'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},BlockIORead]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: B/s
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.BlockIORead
|
||||
-
|
||||
type: CHANGE_PER_SECOND
|
||||
parameters:
|
||||
- ''
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 27f4e3e3a33c412ead03200de17bc9b5
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Disk IO Write'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},BlockIOWrite]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: B/s
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.BlockIOWrite
|
||||
-
|
||||
type: CHANGE_PER_SECOND
|
||||
parameters:
|
||||
- ''
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: f59ee387b12740fc90ff6d990422e92d
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: CPU'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},CPUPerc]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
value_type: FLOAT
|
||||
units: '%'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.CPUPerc
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
trigger_prototypes:
|
||||
-
|
||||
uuid: d2bdccc7bf8a49c6a2c584a5394a0c27
|
||||
expression: 'avg(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},CPUPerc],1h)>{$DOCKER_CPU_PCT_WARN:"{#DOCKER_CONTAINER_NAME}"}'
|
||||
recovery_mode: RECOVERY_EXPRESSION
|
||||
recovery_expression: 'avg(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},CPUPerc],1h)<({$DOCKER_CPU_PCT_WARN:"{#DOCKER_CONTAINER_NAME}"}-2) or avg(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},CPUPerc],5m)<({$DOCKER_CPU_PCT_WARN:"{#DOCKER_CONTAINER_NAME}"}/3)'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} CPU usage is {ITEM.VALUE1}'
|
||||
priority: INFO
|
||||
-
|
||||
uuid: f56ddbaef3af4fa898ae2403a812db3c
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Dead'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Dead]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.State.Dead
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: e09f311feb1749cc88e8c51c8425c324
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Error'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Error]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.State.Error
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: b75ac0b193d2451e8ee3ce0950b7b07a
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Image'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Image]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.Config.Image
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: ba301501bbec40e6add5a47d2fd0ee15
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Memory usage'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemCurrent]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: B
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.MemCurrent
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 5895cddf57fd4b5e8917593cba941491
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Memory limit'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemLimit]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: B
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.MemLimit
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 640bce04f3fc483fa495ac72208effa7
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Memory used (%)'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemPerc]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
value_type: FLOAT
|
||||
units: '%'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.MemPerc
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
trigger_prototypes:
|
||||
-
|
||||
uuid: 9fdd469b0866409ca7889288eb5f229a
|
||||
expression: 'last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemPerc])>{$DOCKER_MEM_PCT_WARN:"{#DOCKER_CONTAINER_NAME}"}'
|
||||
recovery_mode: RECOVERY_EXPRESSION
|
||||
recovery_expression: 'last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemPerc])<({$DOCKER_MEM_PCT_WARN:"{#DOCKER_CONTAINER_NAME}"}-2)'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} memory usage is at {ITEM.LASTVALUE1}'
|
||||
priority: AVERAGE
|
||||
manual_close: 'YES'
|
||||
-
|
||||
uuid: eb58fb55bc0442319650e32a8ba1faf4
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Network in'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},NetIOIn]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: b/s
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.NetIOIn
|
||||
-
|
||||
type: CHANGE_PER_SECOND
|
||||
parameters:
|
||||
- ''
|
||||
-
|
||||
type: MULTIPLIER
|
||||
parameters:
|
||||
- '8'
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 6a97e94be7d1432fb11a92072ea9e55f
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Network out'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},NetIOOut]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: b/s
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.NetIOOut
|
||||
-
|
||||
type: CHANGE_PER_SECOND
|
||||
parameters:
|
||||
- ''
|
||||
-
|
||||
type: MULTIPLIER
|
||||
parameters:
|
||||
- '8'
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 7be56a29b2464c5e96c2f4f2b3e02fba
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: OOMKilled'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},OOMKilled]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.State.OOMKilled
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: a5ed78ba8acf43a488b3833d14e39381
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Number of processes'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},PIDs]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: '!process(es)'
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.PIDs
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 1213e0b7fc824442b50ab4ff4cd1047b
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Restarting'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Restarting]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.State.Restarting
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: 418b35e93f114be986ecdd5a9d259283
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Status'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status]'
|
||||
delay: '0'
|
||||
history: 7d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.inspect.State.Status
|
||||
-
|
||||
type: DISCARD_UNCHANGED_HEARTBEAT
|
||||
parameters:
|
||||
- 1h
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
trigger_prototypes:
|
||||
-
|
||||
uuid: 45e35825ed184b0290d1bc1ed27e48e4
|
||||
expression: 'find(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status],,"regexp","^(running|exited)$")<>1'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} is {ITEM.LASTVALUE1}'
|
||||
priority: WARNING
|
||||
manual_close: 'YES'
|
||||
-
|
||||
uuid: ab2c34de197f4ea197e607604c936f34
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Uptime'
|
||||
type: DEPENDENT
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},Uptime]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: 1095d
|
||||
units: s
|
||||
preprocessing:
|
||||
-
|
||||
type: JSONPATH
|
||||
parameters:
|
||||
- $.stats.Uptime
|
||||
master_item:
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
-
|
||||
uuid: b232a5b3aedd4072a56460dd041579b1
|
||||
name: 'Docker: container {#DOCKER_CONTAINER_NAME}: Info'
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME}]'
|
||||
delay: 5m
|
||||
history: '0'
|
||||
trends: '0'
|
||||
value_type: TEXT
|
||||
trigger_prototypes:
|
||||
-
|
||||
uuid: 57d9a11b38b246539a82bf4ba1a79a98
|
||||
expression: 'last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Uptime])<{$DOCKER_UPTIME_WARN:"{#DOCKER_CONTAINER_NAME}"} and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status],#2)="running" and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status])="running"'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} has just restarted'
|
||||
priority: INFO
|
||||
-
|
||||
uuid: ce3cc3148fa24c6097cbf38b47e9e655
|
||||
expression: 'last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Uptime])<{$DOCKER_UPTIME_WARN:"{#DOCKER_CONTAINER_NAME}"} and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status],#2)="exited" and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status])="running"'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} has just started'
|
||||
priority: INFO
|
||||
-
|
||||
uuid: ebdea3b26c624714811124fe4681ccec
|
||||
expression: 'max(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Uptime],20m)<{$DOCKER_UPTIME_WARN:"{#DOCKER_CONTAINER_NAME}"} and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Uptime])>0 and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status])="running" and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status],#2)="running" and last(/Template_App_Docker/container.docker.check[container,{#DOCKER_CONTAINER_NAME},Status],#3)="running"'
|
||||
name: 'Container {#DOCKER_CONTAINER_NAME} seems to restart in a loop'
|
||||
priority: AVERAGE
|
||||
manual_close: 'YES'
|
||||
graph_prototypes:
|
||||
-
|
||||
uuid: 4a9aa378970045399303dcead39c1e53
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: CPU'
|
||||
ymin_type_1: FIXED
|
||||
graph_items:
|
||||
-
|
||||
sortorder: '1'
|
||||
drawtype: GRADIENT_LINE
|
||||
color: F63100
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},CPUPerc]'
|
||||
-
|
||||
uuid: 7cd7cd8fd24d492ab7995a882b7bf9af
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Disk IO'
|
||||
graph_items:
|
||||
-
|
||||
sortorder: '1'
|
||||
drawtype: FILLED_REGION
|
||||
color: FFAB91
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},BlockIORead]'
|
||||
-
|
||||
sortorder: '2'
|
||||
drawtype: FILLED_REGION
|
||||
color: A5D6A7
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},BlockIOWrite]'
|
||||
-
|
||||
uuid: 0fec757ff2f34e4fbab3be8ea455bc5f
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Memory'
|
||||
ymin_type_1: FIXED
|
||||
graph_items:
|
||||
-
|
||||
sortorder: '1'
|
||||
color: 2774A4
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},MemCurrent]'
|
||||
-
|
||||
uuid: 948dccce10c54510810a64612933ca89
|
||||
name: 'Docker: Container {#DOCKER_CONTAINER_NAME}: Network'
|
||||
graph_items:
|
||||
-
|
||||
sortorder: '1'
|
||||
drawtype: FILLED_REGION
|
||||
color: B39DDB
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},NetIOIn]'
|
||||
-
|
||||
sortorder: '2'
|
||||
drawtype: FILLED_REGION
|
||||
color: 80DEEA
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[container,{#DOCKER_CONTAINER_NAME},NetIOOut]'
|
||||
macros:
|
||||
-
|
||||
macro: '{$DOCKER_CPU_PCT_WARN}'
|
||||
value: '90'
|
||||
-
|
||||
macro: '{$DOCKER_MEM_PCT_WARN}'
|
||||
value: '85'
|
||||
-
|
||||
macro: '{$DOCKER_UPTIME_WARN}'
|
||||
value: '300'
|
||||
-
|
||||
macro: '{$DOCKER_WARN_NO_LIVE_RESTORE}'
|
||||
value: '1'
|
||||
graphs:
|
||||
-
|
||||
uuid: 9c9aba9c46e145c7a8acd208edb1d147
|
||||
name: 'Docker: Number of containers'
|
||||
type: STACKED
|
||||
graph_items:
|
||||
-
|
||||
sortorder: '1'
|
||||
color: 1A7C11
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[global,ContainersPaused]'
|
||||
-
|
||||
sortorder: '2'
|
||||
color: F63100
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[global,ContainersRunning]'
|
||||
-
|
||||
sortorder: '3'
|
||||
color: 2774A4
|
||||
item:
|
||||
host: Template_App_Docker
|
||||
key: 'container.docker.check[global,ContainersStopped]'
|
File diff suppressed because it is too large
Load Diff
2100
zabbix_templates/Template_App_ZFS.yaml
Normal file
2100
zabbix_templates/Template_App_ZFS.yaml
Normal file
File diff suppressed because it is too large
Load Diff
195
zabbix_templates/Template_HW_storageDevices.yaml
Normal file
195
zabbix_templates/Template_HW_storageDevices.yaml
Normal file
|
@ -0,0 +1,195 @@
|
|||
zabbix_export:
|
||||
version: '6.0'
|
||||
date: '2023-12-21T14:57:39Z'
|
||||
groups:
|
||||
- uuid: 7df96b18c230490a9a0a9e2307226338
|
||||
name: Templates
|
||||
templates:
|
||||
- uuid: 98cb8260bbeb4a94a8b07b54608521c8
|
||||
template: Template_HW_storageDevices
|
||||
name: Template_HW_storageDevices
|
||||
groups:
|
||||
- name: Templates
|
||||
discovery_rules:
|
||||
- uuid: 12b9a456943f49aca440958063a5bfe2
|
||||
name: 'SMART capable Storage devices discovery'
|
||||
key: 'stor.dev.discovery[smart]'
|
||||
delay: 1h
|
||||
filter:
|
||||
conditions:
|
||||
- macro: '{#STOR_DEV_SMART}'
|
||||
value: ^1$
|
||||
formulaid: A
|
||||
lifetime: 7d
|
||||
item_prototypes:
|
||||
- uuid: 0743506e1c1b49f5b47bd5cef5462c55
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Pending sectors'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},current_pending_sector]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: '!sector(s)'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.current_pending_sector
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
trigger_prototypes:
|
||||
- uuid: 9ffa5efc061542e8a5f227936396e5ab
|
||||
expression: 'change(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},current_pending_sector])>0'
|
||||
recovery_mode: NONE
|
||||
name: '{ITEM.LASTVALUE1} pending on {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: AVERAGE
|
||||
manual_close: 'YES'
|
||||
- uuid: 3da3d8491a024c7ab4f0bb3fc3887a64
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Firmware version'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},firmware_version]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
trends: '0'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.firmware_version
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
- uuid: 6d4967ca28f549048a507209737fa7bd
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Offline uncorrectable'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},offline_uncorrectable]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: '!sector(s)'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.offline_uncorrectable
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
trigger_prototypes:
|
||||
- uuid: 66c5fc3a96354eb3aae8d5a08eea4544
|
||||
expression: 'change(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},offline_uncorrectable])>0'
|
||||
recovery_mode: NONE
|
||||
name: '{ITEM.LASTVALUE1} offline uncorrectable on {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: HIGH
|
||||
manual_close: 'YES'
|
||||
- uuid: df1ef0de1bc54200895a5d173a583905
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Percent Lifetime Remain'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},percent_lifetime_remain]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: '%'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.percent_lifetime_remain
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
trigger_prototypes:
|
||||
- uuid: caaa6496f8e941a08f37c8746bb34bc2
|
||||
expression: 'last(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},percent_lifetime_remain])<{$STOR_LIFETIME_REMAINING_CRITICAL:"{#STOR_DEV_SN}"}'
|
||||
name: '{ITEM.LASTVALUE1} lifetime remaining for {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: HIGH
|
||||
manual_close: 'YES'
|
||||
- uuid: 1df675ca6c4649a081ea315599ce4284
|
||||
expression: 'last(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},percent_lifetime_remain])<{$STOR_LIFETIME_REMAINING_WARN:"{#STOR_DEV_SN}"}'
|
||||
name: '{ITEM.LASTVALUE1} lifetime remaining for {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: WARNING
|
||||
manual_close: 'YES'
|
||||
dependencies:
|
||||
- name: '{ITEM.LASTVALUE1} lifetime remaining for {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
expression: 'last(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},percent_lifetime_remain])<{$STOR_LIFETIME_REMAINING_CRITICAL:"{#STOR_DEV_SN}"}'
|
||||
- uuid: 70dd4bcd3994423594f7330bbb448038
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Power Cycle Count'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},power_cycle_count]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.power_cycle_count
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
- uuid: f68f569400954636a7e4231c97c57c81
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Power on hours'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},power_on_hours]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: s
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.power_on_hours
|
||||
- type: MULTIPLIER
|
||||
parameters:
|
||||
- '3600'
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
- uuid: 76e724749c304d7da9c38b81bfb9b711
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Reallocated Sectors'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},reallocated_sector_count]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: '!sector(s)'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.reallocated_sector_count
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
trigger_prototypes:
|
||||
- uuid: f7b3fa0f6a8347e3b67387da531a2d1a
|
||||
expression: 'change(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},reallocated_sector_count])>0'
|
||||
recovery_mode: NONE
|
||||
name: '{ITEM.LASTVALUE1} reallocated on {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: WARNING
|
||||
manual_close: 'YES'
|
||||
dependencies:
|
||||
- name: '{ITEM.LASTVALUE1} reallocated on {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
expression: 'last(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},reallocated_sector_count])>{$STOR_REALLOC_SECTOR_WARN:"{#STOR_DEV_SN}"}'
|
||||
- uuid: 85d6eb29ca7b4175bf8ad15414a44936
|
||||
expression: 'last(/Template_HW_storageDevices/stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},reallocated_sector_count])>{$STOR_REALLOC_SECTOR_WARN:"{#STOR_DEV_SN}"}'
|
||||
name: '{ITEM.LASTVALUE1} reallocated on {#STOR_DEV_SN} ({#STOR_DEV_DESC})'
|
||||
priority: AVERAGE
|
||||
manual_close: 'YES'
|
||||
- uuid: 28117d0d998f467ea542821e4a6507c9
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}): Temperature'
|
||||
type: DEPENDENT
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE},temperature_celsius]'
|
||||
delay: '0'
|
||||
history: 30d
|
||||
value_type: FLOAT
|
||||
units: °C
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.temperature_celsius
|
||||
master_item:
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
- uuid: 6d3da698590e43f4be62d5daab7f72f0
|
||||
name: 'Stor dev {#STOR_DEV_SN} ({#STOR_DEV_DESC}) info'
|
||||
key: 'stor.dev.info[{#STOR_DEV_NAME},{#STOR_DEV_TYPE}]'
|
||||
delay: 8m
|
||||
history: '0'
|
||||
trends: '0'
|
||||
value_type: TEXT
|
||||
macros:
|
||||
- macro: '{$STOR_LIFETIME_REMAINING_CRITICAL}'
|
||||
value: '6'
|
||||
- macro: '{$STOR_LIFETIME_REMAINING_WARN}'
|
||||
value: '10'
|
||||
- macro: '{$STOR_REALLOC_SECTOR_WARN}'
|
||||
value: '40'
|
Loading…
Reference in New Issue
Block a user