external scripts that used to work under older version of zabbix now returns "" under 7.4.1 with Ubuntu Linux 24.04.3
inception@superdog:~$ sudo /usr/lib/zabbix/externalscripts/ubntStatus2002 10.47.47.52 signal
-65
inception@superdog:~$ sudo -u zabbix /usr/lib/zabbix/externalscripts/ubntStatus2002 10.47.47.52 signal
inception@superdog:~$
I have enabled AllowKey=system.run[*] in the agent config file.
I have enable EnableGlobalScripts=1 in server config file.
Not sure what else I am missing.
Even more confusing is when ssh failed to add host to the host file the information from the script is returned at the end. (text in red)
Value of type "string" is not suitable for value type "Numeric (unsigned)". Value "Failed to add the host to the list of known hosts (/var/lib/zabbix/.ssh/known_hosts).\r\n5710"
I may have fixed some of these these by changing the ownership of the /var/lib/zabbix/.ssh to zabbix:zabbix mode 0700
But other hosts still show "" being returned after being added to known_hosts.
Here is the script
#!/bin/sh
ubntUser=admin
ubntPass=##########
sshPassBin=/usr/bin/sshpass
sshBin=/usr/bin/ssh
ubntHost=$1
ubntKey=$2
${sshPassBin} -p ${ubntPass} ${sshBin} -o HostKeyAlgorithms=+ssh-dss -l ${ubntUser} ${ubntHost} -p 22 mca-status | grep "^${ubntKey}=" | cut -d= -f2
inception@superdog:~$ sudo /usr/lib/zabbix/externalscripts/ubntStatus2002 10.47.47.52 signal
-65
inception@superdog:~$ sudo -u zabbix /usr/lib/zabbix/externalscripts/ubntStatus2002 10.47.47.52 signal
inception@superdog:~$
I have enabled AllowKey=system.run[*] in the agent config file.
I have enable EnableGlobalScripts=1 in server config file.
Not sure what else I am missing.
Even more confusing is when ssh failed to add host to the host file the information from the script is returned at the end. (text in red)
Value of type "string" is not suitable for value type "Numeric (unsigned)". Value "Failed to add the host to the list of known hosts (/var/lib/zabbix/.ssh/known_hosts).\r\n5710"
I may have fixed some of these these by changing the ownership of the /var/lib/zabbix/.ssh to zabbix:zabbix mode 0700
But other hosts still show "" being returned after being added to known_hosts.
Here is the script
#!/bin/sh
ubntUser=admin
ubntPass=##########
sshPassBin=/usr/bin/sshpass
sshBin=/usr/bin/ssh
ubntHost=$1
ubntKey=$2
${sshPassBin} -p ${ubntPass} ${sshBin} -o HostKeyAlgorithms=+ssh-dss -l ${ubntUser} ${ubntHost} -p 22 mca-status | grep "^${ubntKey}=" | cut -d= -f2
Comment