Closed xenadmin closed 5 years ago
In what shell (and version) are you starting this script?
echo "Default shell is: ${SHELL}"
echo "Current shell is: ${0}"
root@zabprox:/usr/lib/zabbix/externalscripts# echo "Default shell is: ${SHELL}"
Default shell is: /bin/bash
root@zabprox:/usr/lib/zabbix/externalscripts# echo "Current shell is: ${0}"
Current shell is: -bash
OK, at least root
is using bash as the default shell, which is supposed to support -o pipefail
. The script uses #!/bin/bash
as the shebang, which should execute the script with bash anyway.
Can you please try the following steps:
set -o pipefail
from a bash prompt and check if you also get the Illegal option
error messagezabbix
user)echo "0: ${0}" > /tmp/debug.out
echo "SHELL: ${SHELL}" >> /tmp/debug.out
echo "proc-exe: $(readlink /proc/$$/exe)" >> /tmp/debug.out
echo "SHELLOPTS: ${SHELLOPTS}" >> /tmp/debug.out
echo "BASHOPTS: ${BASHOPTS}" >> /tmp/debug.out
echo "BASH_VERSION: ${BASH_VERSION}" >> /tmp/debug.out
/tmp/debug.out
Sorry, I forgot you! I will update this comment tomorrow! Keep up the great work, I will come back to you and your IPMI collection asap!
@xenadmin is this issue still relevant to you? Otherwise I would close it within the next days.
Thanks for your feedback.
I think this can be closed. I switched over to the official SNMP templates (https://www.zabbix.com/documentation/4.0/manual/introduction/whatsnew400#new_templates) and adjusted them to my needs. Many thanks for your help! If I should ever take a look again at IPMI, I will remember you!
Hallo, discovered your work on share.zabbix.com. I downloaded the script and tried to run if from shell, but it fails immediately. Any idea why this happens? Thank you!
EDIT: I'm on Debian 9 Stretch amd64 with Zabbix 3.4.x If I comment out line 47 the script seems to work.