My patch adds 'ExternalScriptsPath' to zabbix_server.conf, it is a path to a directory with executables, the names for which become the item keys. The first argument passed to the executable is the IP address or the hostname if useip!='1'. Anything within [ and ] is passed to the executable as additional command line arguments. If the file cannot be read or executed it should be tagged as "unsupported" and become disabled.
I think the UserParameter statements are brilliant for agent configuration, but you cannot run an agent everywhere, and the ability for Zabbix to run external scripts from the server itself is essential in order to achieve the flexibility it needs to become a good all round monitoring/alerting system.
Using UserParameter also also means agent reconfiguration and restart, as well as (ideally) requiring that each individual agent configuration file is monitoring and copied to CVS with something like RANCID.
This is just a request for comment really. Can anyone see any major drawbacks to this (multiple layers of fork/context switches yes I know), or any problems with the code that I've not anticipated ? Any suggestions etc ?
I think a flexible compiled plugin system would be more ideal for extending Zabbix with a reasonable level of assurity that the function performed is trustworthy and the type and extent of results will be guaranteed. Has anyone started work on something like that ?
Example for external items,
[root@zabbix zabbix]# ls -l /usr/lib/zabbix/external/
total 32
-rwxr-xr-x 1 zabbix zabbix 363 May 31 17:33 latency
-rwxr-xr-x 1 zabbix zabbix 794 May 31 18:25 packetloss
-rwxr-xr-x 1 zabbix zabbix 398 May 31 17:33 ping
-rwxr-xr-x 1 zabbix zabbix 970 May 31 17:43 temptraxe
[root@zabbix zabbix]# cat /usr/lib/zabbix/external/temptraxe
#!/bin/sh
CHECK_TEMPTRAXE="/usr/lib/nagios/plugins/contrib/check_temptraxe"
HOST="${1}"
PROBE="${2}"
if [ -z "${HOST}" ]
then
echo "Usage: ${0} <HOST> [<PROBE>]"
exit 1
fi
if [ -z "${PROBE}" ]
then
PROBE=1
fi
RESULT=`${CHECK_TEMPTRAXE} --celsius -H ${HOST} -p ${PROBE} | grep ^Temp | sed -e "s/^.*=\ //" -e "s/\ C.*$//"`
if [ -z "${RESULT}" ]
then
echo "999.0"
else
echo "${RESULT}"
fi
# EOF
mysql> SELECT key_, hostid, nextcheck, lastvalue, status, units, delta FROM items WHERE type='8' AND key_ LIKE '%temptrax%';
+--------------+--------+------------+-----------+--------+-------+-------+
| key_ | hostid | nextcheck | lastvalue | status | units | delta |
+--------------+--------+------------+-----------+--------+-------+-------+
| temptraxe[1] | 10059 | 1117897980 | 13.9 | 0 | degC | 0 |
| temptraxe[2] | 10059 | 1117897980 | 30.3 | 0 | degC | 0 |
| temptraxe[4] | 10059 | 1117897980 | 23.4 | 0 | degC | 0 |
| temptraxe[3] | 10059 | 1117897980 | 27.2 | 0 | degC | 0 |
+--------------+--------+------------+-----------+--------+-------+-------+
4 rows in set (0.02 sec)
mysql> SELECT key_, hostid, nextcheck, lastvalue, status, units, delta FROM items WHERE type='8' AND hostid='10018';
+------------+--------+------------+-----------+--------+-------+-------+
| key_ | hostid | nextcheck | lastvalue | status | units | delta |
+------------+--------+------------+-----------+--------+-------+-------+
| latency | 10018 | 1117531500 | 15.7 | 0 | ms | 0 |
| packetloss | 10018 | 1117531500 | 0 | 1 | % | 0 |
+------------+--------+------------+-----------+--------+-------+-------+
2 rows in set (0.01 sec)
mysql>

I am still getting a connection refused.
Comment