ninjaserif / TIP-QNAP-resource-usage-snmp

Telegraf Input Plugin - QNAP resource usage SNMP
GNU General Public License v3.0
1 stars 0 forks source link

SNMPGET not found #1

Open joelang1699 opened 3 years ago

joelang1699 commented 3 years ago

[/usr/local/bin/TIP-QNAP-resource-usage-snmp] # ./TIP-QNAP-resource-usage-snmp.sh ./TIP-QNAP-resource-usage-snmp.sh: line 27: snmpget: command not found ./TIP-QNAP-resource-usage-snmp.sh: line 31: mapfile: command not found ./TIP-QNAP-resource-usage-snmp.sh: line 34: mapfile: command not found

I've tried this on three x86 based QNAP devices all with the same output. Any ideas?

ninjaserif commented 3 years ago

hey @joelang1699 ,

Thanks for reaching out.

snmpget is part of the snmp package which was one of the pre-requisites I mentioned in the readme to install for this script to work.

Regarding mapfile - I did some digging and this is part of the bash shell which I developed / run this on. I am running this on a Raspberry Pi 3B+ which is running Rasbian (Stretch). The script is reading the stats from my QNAP which is on the same network. It sounds like you are running this directly on the QNAP

You can check what version of bash you have by running echo "${BASH_VERSION}" - I am running 4.4.12(1)-release. I suspect your machines are running a version <4 as I have read that does not contain the mapfile command.

I could possibly replace mapfile with an alternate method of reading in the files into an array using IFS.

Cheers, Scott