From eabece819356734e2d6372511fbe4cd0bb9d3589 Mon Sep 17 00:00:00 2001 From: in-famous-raccoon Date: Mon, 4 Apr 2022 21:56:05 +0200 Subject: [PATCH] added ZFS + Ceph Scripts --- README.md | 4 +++- snmp-ceph-used.sh | 8 ++++++++ snmp-zfs-used.sh | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 snmp-ceph-used.sh create mode 100644 snmp-zfs-used.sh diff --git a/README.md b/README.md index badc977..d3c8fe1 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,10 @@ ### Paste content from sh file to /opt folder and make executable `nano /opt/snmp-cpu-temp.sh`
-`nano /opt/snmp-lvm-used.sh`
`nano /opt/snmp-smart-status.sh`
+`nano /opt/snmp-lvm-used.sh` for LVM
+`nano /opt/snmp-zfs-used.sh` for ZFS
+`nano /opt/snmp-ceph-used.sh` for Ceph
`chmod +x /opt/snmp-*` ### Run snmpd as root, because debian added the user "Debian-snmp" to the snmp.service but for SMART/LVM Status we need to be root. diff --git a/snmp-ceph-used.sh b/snmp-ceph-used.sh new file mode 100644 index 0000000..f7f304a --- /dev/null +++ b/snmp-ceph-used.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ "$1" = "-g" ] +then +echo .1.3.6.1.2.1.25.1.12 +echo gauge +ceph osd df | grep "TOTAL" | awk '{print $14}' +fi +exit 0 diff --git a/snmp-zfs-used.sh b/snmp-zfs-used.sh new file mode 100644 index 0000000..c899e3a --- /dev/null +++ b/snmp-zfs-used.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ "$1" = "-g" ] +then +echo .1.3.6.1.2.1.25.1.11 +echo gauge +zpool list rpool | grep "rpool" | awk '{print $3}' | sed 's/[A-Z]//g' +fi +exit 0