Hello!
I'm trying to create Template for agentless Solaris monitoring in Zabbix.
Here I trying to create LLD of Solaris disks. For my LLD I use SSH check and in Script box I type:
After I start this LLD on Solaris, I get error: Value Should be a JSON object.
Here is what I know:
1) Exactly the same LLD work fine on Linux. The only change is /etc/mtab instead of /etc/mnttab
2) If I create /tmp/fs.sh file on solaris with this code, it also work fine and return me valid JSON.
3) If I put /tmp/fs.sh in script field of LLD rule in solaris, LLD is also work fine.
The only problem is if I trying to put script itseld in script field of LLD rule.
Where is the problem? May be somebody find solution?
I'm trying to create Template for agentless Solaris monitoring in Zabbix.
Here I trying to create LLD of Solaris disks. For my LLD I use SSH check and in Script box I type:
Code:
#!/usr/bin/bash
{
echo "{"
echo " \"data\":["
while read -r line; do
FSNAME=$(echo $line|awk '{print $2}'|sed -e 's/\\/\\\\/g' -e 's|/|\\/|g' -e 's/\./\\./g')
FSTYPE=$(echo $line|awk '{print $3}')
echo " {"
echo " \"{#FSNAME}\":\"${FSNAME}\","
echo " \"{#FSTYPE}\":\"${FSTYPE}\""
echo " },"
done < /etc/mnttab | sed -e '$d'
echo " }"
echo " ]"
echo "}"
}
Here is what I know:
1) Exactly the same LLD work fine on Linux. The only change is /etc/mtab instead of /etc/mnttab
2) If I create /tmp/fs.sh file on solaris with this code, it also work fine and return me valid JSON.
3) If I put /tmp/fs.sh in script field of LLD rule in solaris, LLD is also work fine.
The only problem is if I trying to put script itseld in script field of LLD rule.
Where is the problem? May be somebody find solution?
Comment