User Parameters as Custom Checks in Zabbix

If we're lucky, this page will expand as I do further installs. December 2011.
The hardware: environmental sensors.
We'll be using two temperature sensors. The first is an MS-TH, temperature and humidity, and the second is an MS-TL, tempurature and light, from iButtonLink.com.
Test the hardware.
We'll need local software. In FreeBSD, run portmaster misc/digitemp (See ports.txt for tips on using Ports).
Test the CLI software
Using the software that reads the devices, let's tell it first with -s the serial port to use, here it's my second USB. We also need to initialize a configuration file and make it global. Once the config is in place, let's test again by scanning all sensors with -a and quieting Brian Lane's copyright notice.
/usr/local/bin/digitemp_DS9097U -s /dev/cuaU1 -i
mv .digitemprc /etc/digitemp.conf
/usr/local/bin/digitemp_DS9097U -c /etc/digitemp.conf -a -q
Expected output:
Jan 23 00:16:18 Sensor 0 C: 23.28 F: 73.91 H: 0
Jan 23 00:16:19 Sensor 1 C: 23.16 F: 73.68 H: 40
Create a shell script
Here... scripts Run it from cron like so:
*	*	*	*	*	zabbix	/usr/local/bin/ptudor-zabbix-digitemp.sh
Tell the Zabbix Agent about the script we made and its output
mkdir -p /usr/local/etc/zabbix/agent-includes/
echo "Include=/usr/local/etc/zabbix/agent-includes/" >> /usr/local/etc/zabbix/zabbix_agent.conf
cat digitemp.conf
That digitemp.conf just uses awk to pull each number of the files. I've seen CPU-intensive methods that call the data collection program for every single user-parameter; my own style as you've seen is to snapshot once a minute and let simple tools post-process and present the data.
#UserParameter=mysql.version,mysql -V
UserParameter=digitemp.sensor0.1,awk '{print $1}' < /tmp/zabbix/local_data/digitemp-temp0
UserParameter=digitemp.sensor0.2,awk '{print $2}' < /tmp/zabbix/local_data/digitemp-temp0
UserParameter=digitemp.sensor0.3,awk '{print $3}' < /tmp/zabbix/local_data/digitemp-temp0
UserParameter=digitemp.sensor1.1,awk '{print $1}' < /tmp/zabbix/local_data/digitemp-temp1
UserParameter=digitemp.sensor1.2,awk '{print $2}' < /tmp/zabbix/local_data/digitemp-temp1
UserParameter=digitemp.sensor1.3,awk '{print $3}' < /tmp/zabbix/local_data/digitemp-temp1
Tell the Zabbix Server we're making a new Template
Create a new Zabbix Application
Create a Zabbix Item
Look at Latest Data
Create a Zabbix Trigger
Look at the Overview
Create the rest of the items...
Thanks,
Copyright © 2011 Patrick Tudor