dusharu / ZBX_Disk_Stat

Send statistic from /proc/diskstats to Zabbix
GNU General Public License v3.0
7 stars 5 forks source link

sh: 1: [[: not found] #4

Closed maxxer closed 4 years ago

maxxer commented 4 years ago

Ubuntu 18.04, Zabbix agent 4.0.22.

$ zabbix_agentd -t custom.blkdev.all_stat[sda]
custom.blkdev.all_stat[sda]                   [t|sh: 1: [[: not found
sh: 1: [[: not found]

I tried both config files. Looks like the default shell in Ubuntu is sh, not supporting the [[ syntax.

maxxer commented 4 years ago

Wondering how it works, as from this (old) thread sh is hardcoded in agent's source

dusharu commented 4 years ago

Thank you for your feedback. I thought that all distro have link from sh to bash.

I try to fix today.

 whereis sh
sh: /bin/sh /usr/share/man/man1p/sh.1p.bz2

ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Apr 20 14:15 /bin/sh -> bash
dusharu commented 4 years ago

Done. Please try new version.

Test with sh on Debian-10.4

echo $0
sh

cat /etc/debian_version 
10.4

whereis sh
sh: /bin/sh /bin/sh.distrib /usr/share/man/man1/sh.1.gz

ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan 17  2019 /bin/sh -> dash
maxxer commented 4 years ago

I have to use the awk version but it works, thank you very much