summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrás Wacha2019-05-30 10:10:56 +0200
committerAndrás Wacha2019-05-30 10:10:56 +0200
commitcf7e24429782c455c1442e4c74c6bf325e7ab495 (patch)
tree9a3aa9321cba5eb32ac3bc6195784a1448dad163
parentf90d950d99cfedcd2683dcb38448bdaf03f15ff7 (diff)
downloadaur-monitoring-plugins-qnap.tar.gz
Added patch for authentication
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD12
-rw-r--r--authentication.patch104
3 files changed, 116 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 761b0c5c371..e9dfa2f6569 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,14 @@
pkgbase = monitoring-plugins-qnap
pkgdesc = This plugin sends SNMP queries to a QNAP NAS and checks the cpu, HDD status, system temperature, HDD temperature
pkgver = 1.40
- pkgrel = 1
+ pkgrel = 2
url = https://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/Others/check_qnap
arch = x86_64
license = GPL
source = check_qnap.sh::https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=5931&cf_id=29
+ source = authentication.patch
md5sums = b0762dc0ac03cbe43c75e3a367115aa7
+ md5sums = SKIP
pkgname = monitoring-plugins-qnap
diff --git a/PKGBUILD b/PKGBUILD
index e8fde249c97..052b6df80b6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,20 @@
# Maintainer: András Wacha <awacha@gmail.com>
pkgname=monitoring-plugins-qnap
pkgver=1.40
-pkgrel=1
+pkgrel=2
pkgdesc="This plugin sends SNMP queries to a QNAP NAS and checks the cpu, HDD status, system temperature, HDD temperature"
arch=( x86_64 )
url="https://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/Others/check_qnap"
license=('GPL')
depends=()
-source=("check_qnap.sh::https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=5931&cf_id=29")
-md5sums=('b0762dc0ac03cbe43c75e3a367115aa7')
+source=("check_qnap.sh::https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=5931&cf_id=29"
+ "authentication.patch")
+md5sums=('b0762dc0ac03cbe43c75e3a367115aa7'
+ 'SKIP')
+
+prepare() {
+ patch -f ../check_qnap.sh < authentication.patch
+}
package() {
mkdir -p $pkgdir/usr/lib/monitoring-plugins/
diff --git a/authentication.patch b/authentication.patch
new file mode 100644
index 00000000000..9a131dd6c03
--- /dev/null
+++ b/authentication.patch
@@ -0,0 +1,104 @@
+--- check_qnap.sh.orig 2019-05-30 10:04:30.438908176 +0200
++++ check_qnap.sh 2019-05-30 10:09:13.745890354 +0200
+@@ -25,33 +25,34 @@
+ usage="
+ -ver Check_qnap Version
+ -C community default public
+--t timeout default 10 secdons
++-t timeout default 10 seconds
+ -v snmpversion default 2c
+--p snmpport defauilt 161
+--a checks you can use
+- cpuload: check´s the system CPU load in perent
+- cputemp: check´s the sytem CPU Temperature
+- systemp: check´s the system Temperature
+- hdtemp: check´s the Harddive Temperature
+- diskusage: check´s the diskusage on perent
+- mem: check´s the mem usage in perent
+- volstatus: check´s the Volume status
+- fan: check´s the Fan Speed
+- hdstatus: check´s the Harddive status
+- cachediskstatus: check´s the Cachedisk status
+- lunstatus: check´s the LUN status
+- raidstatus: check´s the Raid status
+- powerstatus: check´s the Power status
+- sysinfo: provides the QNAP infos
+-example
++-p snmpport default 161
++-a checks you can use
++ cpuload: checks the system CPU load
++ cputemp: checks the sytem CPU Temperature
++ systemp: checks the system Temperature
++ hdtemp: checks the Harddive Temperature
++ diskusage: checks the diskusage
++ mem: checks the mem usage
++ volstatus: checks the Volume status
++ fan: checks the Fan Speed
++ hdstatus: checks the Harddive status
++ cachediskstatus: checks the Cachedisk status
++ lunstatus: checks the LUN status
++ raidstatus: checks the Raid status
++ powerstatus: checks the Power status
++ sysinfo: provides the QNAP infos
++
++Example
+
+-check_qanp -H 192.168.0.2 -a mem
++check_qnap -H 192.168.0.2 -a mem
+
+-responce: OK: Memory Total=15976MB used=9177MB free:6799MB|Memory usage=43%;80;90;0;100
++response: OK: Memory Total=15976MB used=9177MB free:6799MB|Memory usage=43%;80;90;0;100
+
+ or
+
+-check_qanp -H myqnap.domain.com -C public -v 1 -p 123 -a cputemp -u F -w 40 -c 45 -t 60
++check_qnap -H myqnap.domain.com -C public -v 1 -p 123 -a cputemp -u F -w 40 -c 45 -t 60
+ checked host myqnap.domain.com
+ community public
+ snmpversion 1
+@@ -64,7 +65,7 @@
+
+ "
+
+-while getopts H:b:C:t:v:p:a:w:c:u:help:h option;
++while getopts H:b:C:t:v:p:a:w:c:u:help:h:U:P option;
+ do
+ case $option in
+ H) hostaddress=$OPTARG;;
+@@ -77,6 +78,8 @@
+ w) warning=$OPTARG;;
+ c) critical=$OPTARG;;
+ u) unit=$OPTARG;;
++ U) username=$OPTARG;;
++ P) password=$OPTARG;;
+ h) help=1;;
+ esac
+ done
+@@ -100,6 +103,18 @@
+ }
+ check
+
++if [[ -z "$username" ]]; then
++ usernameargs=""
++else
++ usernameargs="-u ${username}"
++fi
++
++if [[ -z "$password" ]]; then
++ pwargs=""
++else
++ pwargs="-A ${password} -X ${password}"
++fi
++
+ if [[ -z "$community" ]]; then
+ community=public;
+ fi
+@@ -158,7 +173,7 @@
+ okqty=0
+ avg=0
+
+-mysnmpcheck="snmpget -v $snmpversion -c $community -t $timeout $hostaddress:$snmpport"
++mysnmpcheck="snmpget -v $snmpversion -c $community -t $timeout $hostaddress:$snmpport ${usernameargs} ${pwargs}"
+
+
+ # DISKUSAGE