zabbix scripts monit zfs
This commit is contained in:
17
service/zabbix/check_zfs.pl
Normal file
17
service/zabbix/check_zfs.pl
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $ZPOOL = '/sbin/zpool';
|
||||
my $status_output = `$ZPOOL status 2>/dev/null`;
|
||||
|
||||
if ($? != 0) {
|
||||
print "The zfs file system was not found\n";
|
||||
exit 0
|
||||
}
|
||||
|
||||
if ($status_output =~ /degraded/i) {
|
||||
print "degraded\n";
|
||||
}
|
||||
|
||||
|
||||
11
service/zabbix/man/readme.md
Normal file
11
service/zabbix/man/readme.md
Normal file
@@ -0,0 +1,11 @@
|
||||
## zabbix_agentd.conf
|
||||
#### check zfs
|
||||
```ini
|
||||
UserParameter=zpool.check,/etc/zabbix/scripts/zpool_check.pl
|
||||
```
|
||||
|
||||
## trigger
|
||||
#### check zfs
|
||||
```
|
||||
{Template ZFS Pool:zpool.check.str(degraded)}=1
|
||||
```
|
||||
Reference in New Issue
Block a user