From: Colin S. <co...@in...> - 2005-06-03 08:22:57
|
Also testing if there's actually any activity on the damn list. 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. Anything within [ and ] is passed to the executable as 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.=20 It also means agent reconfiguration and restart, as well as the ideal of = maintaining a modification history for individual agent configurations = is not necessary. 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 ? This is unfortuanetly only against 1.1alpha9, as I'm yet to update to = 1.1alpha10. 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=3D"/usr/lib/nagios/plugins/contrib/check_temptraxe" HOST=3D"${1}" PROBE=3D"${2}" if [ -z "${HOST}" ] then echo "Usage: ${0} <HOST> [<PROBE>]" exit 1 fi if [ -z "${PROBE}" ] then PROBE=3D1 fi RESULT=3D`${CHECK_TEMPTRAXE} --celsius -H ${HOST} -p ${PROBE} | grep = ^Temp | sed -e "s/^.*=3D\ //" -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=3D'8' AND key_ LIKE '%temptrax%'; +--------------+--------+------------+-----------+--------+-------+------= -+ | key_ | hostid | nextcheck | lastvalue | status | units | = delta | +--------------+--------+------------+-----------+--------+-------+------= -+ | temptraxe[1] | 10059 | 1117785600 | 13.4 | 0 | =B0C | = 0 | | temptraxe[2] | 10059 | 1117785600 | 24.9 | 0 | =B0C | = 0 | | temptraxe[4] | 10059 | 1117785600 | 25.7 | 0 | =B0C | = 0 | | temptraxe[3] | 10059 | 1117785600 | 30.1 | 0 | =B0C | = 0 | +--------------+--------+------------+-----------+--------+-------+------= -+ 4 rows in set (0.03 sec) mysql> SELECT key_, hostid, nextcheck, lastvalue, status, units, delta = FROM items WHERE type=3D'8' AND hostid=3D'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) Regards Colin Stubbs Systems Engineer IntraPower Pty Ltd Level 14, 167 Eagle Street Brisbane QLD 4000 Australia Phone: +61 7 3032 3030 Fax +61 7 3032 3001 Email: su...@in... |