forked from zabbix/community-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added missing agent conf file with user parameters
* fixed templates with inappropriate use of $1 and $2 variables for 5.4 and .60 someone else can wrangle with the XML for 5.0 I am not
- Loading branch information
Showing
8 changed files
with
294 additions
and
48 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
Operating_Systems/Linux/template_zfs_on_linux/5.0/ZoL_with_sudo.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ZFS discovery and configuration | ||
# original template from pbergbolt (source = https://www.zabbix.com/forum/showthread.php?t=43347), modified by Slash <[email protected]> | ||
|
||
|
||
# pool discovery | ||
UserParameter=zfs.pool.discovery,/usr/bin/sudo /sbin/zpool list -H -o name | sed -e '$ ! s/\(.*\)/{"{#POOLNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#POOLNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# dataset discovery, called "fileset" in the zabbix template for legacy reasons | ||
UserParameter=zfs.fileset.discovery,/usr/bin/sudo /sbin/zfs list -H -o name | sed -e '$ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#FILESETNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# vdev discovery | ||
UserParameter=zfs.vdev.discovery,/usr/bin/sudo /sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
|
||
# pool health | ||
UserParameter=zfs.zpool.health[*],/usr/bin/sudo /sbin/zpool list -H -o health $1 | ||
|
||
# get any fs option | ||
UserParameter=zfs.get.fsinfo[*],/usr/bin/sudo /sbin/zfs get -o value -Hp $2 $1 | ||
|
||
# compressratio need special treatment because of the "x" at the end of the number | ||
UserParameter=zfs.get.compressratio[*],/usr/bin/sudo /sbin/zfs get -o value -Hp compressratio $1 | sed "s/x//" | ||
|
||
# memory used by ZFS: sum of the SPL slab allocator's statistics | ||
# "There are a few things not included in that, like the page cache used by mmap(). But you can expect it to be relatively accurate." | ||
UserParameter=zfs.memory.used,echo $(( `cat /proc/spl/kmem/slab | tail -n +3 | awk '{ print $3 }' | tr "\n" "+" | sed "s/$/0/"` )) | ||
|
||
# get any global zfs parameters | ||
UserParameter=zfs.get.param[*],cat /sys/module/zfs/parameters/$1 | ||
|
||
# ARC stats from /proc/spl/kstat/zfs/arcstats | ||
UserParameter=zfs.arcstats[*],awk '/^$1/ {printf $$3;}' /proc/spl/kstat/zfs/arcstats | ||
|
||
# detect if a scrub is in progress, 0 = in progress, 1 = not in progress | ||
UserParameter=zfs.zpool.scrub[*],/usr/bin/sudo /sbin/zpool status $1 | grep "scrub in progress" > /dev/null ; echo $? | ||
|
||
# vdev state | ||
UserParameter=zfs.vdev.state[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$2 }' | ||
# vdev READ error counter | ||
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si | ||
# vdev WRITE error counter | ||
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si | ||
# vdev CHECKSUM error counter | ||
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si |
41 changes: 41 additions & 0 deletions
41
Operating_Systems/Linux/template_zfs_on_linux/5.0/userparams_zol_without_sudo.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ZFS discovery and configuration | ||
# original template from pbergbolt (source = https://www.zabbix.com/forum/showthread.php?t=43347), modified by Slash <[email protected]> | ||
|
||
|
||
# pool discovery | ||
UserParameter=zfs.pool.discovery,/sbin/zpool list -H -o name | sed -e '$ ! s/\(.*\)/{"{#POOLNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#POOLNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# dataset discovery, called "fileset" in the zabbix template for legacy reasons | ||
UserParameter=zfs.fileset.discovery,/sbin/zfs list -H -o name | sed -e '$ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#FILESETNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# vdev discovery | ||
UserParameter=zfs.vdev.discovery,/sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
|
||
# pool health | ||
UserParameter=zfs.zpool.health[*],/sbin/zpool list -H -o health $1 | ||
|
||
# get any fs option | ||
UserParameter=zfs.get.fsinfo[*],/sbin/zfs get -o value -Hp $2 $1 | ||
|
||
# compressratio need special treatment because of the "x" at the end of the number | ||
UserParameter=zfs.get.compressratio[*],/sbin/zfs get -o value -Hp compressratio $1 | sed "s/x//" | ||
|
||
# memory used by ZFS: sum of the SPL slab allocator's statistics | ||
# "There are a few things not included in that, like the page cache used by mmap(). But you can expect it to be relatively accurate." | ||
UserParameter=zfs.memory.used,echo $(( `cat /proc/spl/kmem/slab | tail -n +3 | awk '{ print $3 }' | tr "\n" "+" | sed "s/$/0/"` )) | ||
|
||
# get any global zfs parameters | ||
UserParameter=zfs.get.param[*],cat /sys/module/zfs/parameters/$1 | ||
|
||
# ARC stats from /proc/spl/kstat/zfs/arcstats | ||
UserParameter=zfs.arcstats[*],awk '/^$1/ {printf $$3;}' /proc/spl/kstat/zfs/arcstats | ||
|
||
# detect if a scrub is in progress, 0 = in progress, 1 = not in progress | ||
UserParameter=zfs.zpool.scrub[*],/sbin/zpool status $1 | grep "scrub in progress" > /dev/null ; echo $? | ||
|
||
# vdev state | ||
UserParameter=zfs.vdev.state[*],/sbin/zpool status | grep "$1" | awk '{ print $$2 }' | ||
# vdev READ error counter | ||
UserParameter=zfs.vdev.error_counter.read[*],/sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si | ||
# vdev WRITE error counter | ||
UserParameter=zfs.vdev.error_counter.write[*],/sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si | ||
# vdev CHECKSUM error counter | ||
UserParameter=zfs.vdev.error_counter.cksum[*],/sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Operating_Systems/Linux/template_zfs_on_linux/5.4/userparams_zol_with_sudo.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ZFS discovery and configuration | ||
# original template from pbergbolt (source = https://www.zabbix.com/forum/showthread.php?t=43347), modified by Slash <[email protected]> | ||
|
||
|
||
# pool discovery | ||
UserParameter=zfs.pool.discovery,/usr/bin/sudo /sbin/zpool list -H -o name | sed -e '$ ! s/\(.*\)/{"{#POOLNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#POOLNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# dataset discovery, called "fileset" in the zabbix template for legacy reasons | ||
UserParameter=zfs.fileset.discovery,/usr/bin/sudo /sbin/zfs list -H -o name | sed -e '$ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#FILESETNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# vdev discovery | ||
UserParameter=zfs.vdev.discovery,/usr/bin/sudo /sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
|
||
# pool health | ||
UserParameter=zfs.zpool.health[*],/usr/bin/sudo /sbin/zpool list -H -o health $1 | ||
|
||
# get any fs option | ||
UserParameter=zfs.get.fsinfo[*],/usr/bin/sudo /sbin/zfs get -o value -Hp $2 $1 | ||
|
||
# compressratio need special treatment because of the "x" at the end of the number | ||
UserParameter=zfs.get.compressratio[*],/usr/bin/sudo /sbin/zfs get -o value -Hp compressratio $1 | sed "s/x//" | ||
|
||
# memory used by ZFS: sum of the SPL slab allocator's statistics | ||
# "There are a few things not included in that, like the page cache used by mmap(). But you can expect it to be relatively accurate." | ||
UserParameter=zfs.memory.used,echo $(( `cat /proc/spl/kmem/slab | tail -n +3 | awk '{ print $3 }' | tr "\n" "+" | sed "s/$/0/"` )) | ||
|
||
# get any global zfs parameters | ||
UserParameter=zfs.get.param[*],cat /sys/module/zfs/parameters/$1 | ||
|
||
# ARC stats from /proc/spl/kstat/zfs/arcstats | ||
UserParameter=zfs.arcstats[*],awk '/^$1/ {printf $$3;}' /proc/spl/kstat/zfs/arcstats | ||
|
||
# detect if a scrub is in progress, 0 = in progress, 1 = not in progress | ||
UserParameter=zfs.zpool.scrub[*],/usr/bin/sudo /sbin/zpool status $1 | grep "scrub in progress" > /dev/null ; echo $? | ||
|
||
# vdev state | ||
UserParameter=zfs.vdev.state[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$2 }' | ||
# vdev READ error counter | ||
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si | ||
# vdev WRITE error counter | ||
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si | ||
# vdev CHECKSUM error counter | ||
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si |
41 changes: 41 additions & 0 deletions
41
Operating_Systems/Linux/template_zfs_on_linux/5.4/userparams_zol_without_sudo.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ZFS discovery and configuration | ||
# original template from pbergbolt (source = https://www.zabbix.com/forum/showthread.php?t=43347), modified by Slash <[email protected]> | ||
|
||
|
||
# pool discovery | ||
UserParameter=zfs.pool.discovery,/sbin/zpool list -H -o name | sed -e '$ ! s/\(.*\)/{"{#POOLNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#POOLNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# dataset discovery, called "fileset" in the zabbix template for legacy reasons | ||
UserParameter=zfs.fileset.discovery,/sbin/zfs list -H -o name | sed -e '$ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#FILESETNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
# vdev discovery | ||
UserParameter=zfs.vdev.discovery,/sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/' | ||
|
||
# pool health | ||
UserParameter=zfs.zpool.health[*],/sbin/zpool list -H -o health $1 | ||
|
||
# get any fs option | ||
UserParameter=zfs.get.fsinfo[*],/sbin/zfs get -o value -Hp $2 $1 | ||
|
||
# compressratio need special treatment because of the "x" at the end of the number | ||
UserParameter=zfs.get.compressratio[*],/sbin/zfs get -o value -Hp compressratio $1 | sed "s/x//" | ||
|
||
# memory used by ZFS: sum of the SPL slab allocator's statistics | ||
# "There are a few things not included in that, like the page cache used by mmap(). But you can expect it to be relatively accurate." | ||
UserParameter=zfs.memory.used,echo $(( `cat /proc/spl/kmem/slab | tail -n +3 | awk '{ print $3 }' | tr "\n" "+" | sed "s/$/0/"` )) | ||
|
||
# get any global zfs parameters | ||
UserParameter=zfs.get.param[*],cat /sys/module/zfs/parameters/$1 | ||
|
||
# ARC stats from /proc/spl/kstat/zfs/arcstats | ||
UserParameter=zfs.arcstats[*],awk '/^$1/ {printf $$3;}' /proc/spl/kstat/zfs/arcstats | ||
|
||
# detect if a scrub is in progress, 0 = in progress, 1 = not in progress | ||
UserParameter=zfs.zpool.scrub[*],/sbin/zpool status $1 | grep "scrub in progress" > /dev/null ; echo $? | ||
|
||
# vdev state | ||
UserParameter=zfs.vdev.state[*],/sbin/zpool status | grep "$1" | awk '{ print $$2 }' | ||
# vdev READ error counter | ||
UserParameter=zfs.vdev.error_counter.read[*],/sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si | ||
# vdev WRITE error counter | ||
UserParameter=zfs.vdev.error_counter.write[*],/sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si | ||
# vdev CHECKSUM error counter | ||
UserParameter=zfs.vdev.error_counter.cksum[*],/sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si |
Oops, something went wrong.