On OSX you can use the following UserPameters in the config file to get a little more possibilities where the agent can’t help you yet..

 

Get CPU load in % (as opposed to avg1, avg5 and avg15) – formula takes top output idle % and subtracts it fom 100

UserParameter=cpu.percent,echo 100-`top -l 1 | awk '/CPU usage/ { print $7 }' | sed 's/.$//'`|bc

Check if a service is present if the process list – in the trigger you need to specify the Service name (eg: service[Activity Monitor])

UserParameter=service[*],pid=`pgrep "$1"`; if [ $pid -gt "0" ]; then echo "$pid"; else echo "0"; fi

 

These are tested on a 10.8.5 system with zabbix 2.2.2

Leave a Reply