Several of the available options have modes that can be specified, however the documentation doesn't specify what these modes are. For instance, net.if.out[if <,mode>]
It defaults to bytes, which on a graph is fairly unreadable for me. Plus, it appears to be the total ammount of traffic through an interface more than a current measurment. I had similar issues with things like ram and disk space.
My solution to this was to write up a few scripts that could be used by the zabbix agent to scrape data in a way that I wanted it presented. Over time, I've writen a couple of these, and today decided to clump them all together in one script.
Excuse my subpar scripting abilities, and I welcome any changes/additions/suggestions for better ways I could have scripted something.
It might create an error the first time you run it with -r or -t, but thats normal. It will be fine after that. This works on my system, which is Debian, however YMMV. Add it in your agentd.conf with the same format as the mysql user parameters, and make sure you either specify the full path to the script or add it to /bin.
Thanks Alexi and company, for making such and awesome product.
Brian
It defaults to bytes, which on a graph is fairly unreadable for me. Plus, it appears to be the total ammount of traffic through an interface more than a current measurment. I had similar issues with things like ram and disk space.
My solution to this was to write up a few scripts that could be used by the zabbix agent to scrape data in a way that I wanted it presented. Over time, I've writen a couple of these, and today decided to clump them all together in one script.
Excuse my subpar scripting abilities, and I welcome any changes/additions/suggestions for better ways I could have scripted something.
#/bin/bash
#ZABBYTES 2.0
#This is a rewrite of some of the funcitons already available in zabbix, but it returns numbers that are easier to read at a glance
#on graphs. It also provided me with a chance to work on my weak shell scripting skills. Anyone is allowed to do
#whatever they want this. Go ahead and tell your boss you wrote it. He'll likely chide you for your sub-par scritping abilities. ;-)
#Written by Brian Warsawsky for use with Zabbix.
#Thanks, Alexi and Zabbix team, for making this awesome program. You guys kick ass!
#NETWORK TX FUNCTION
tx() {
if [ -n $INTERFACE ]; then
INTERFACE=eth0
fi
eth0_tx=`/sbin/ifconfig $INTERFACE | grep "TX bytes" | cut -d":" -f3 | cut -d" " -f1`
eth0_tx_kb=`expr $eth0_tx '/' 1024`
expr $eth0_tx_kb - `cat /tmp/eth0_tx.zab`
echo $eth0_tx_kb > /tmp/eth0_tx.zab
exit 0
}
#NETWORK RX FUNCTION
rx() {
if [ -n $INTERFACE ]; then
INTERFACE=eth0
fi
eth0_rx=`/sbin/ifconfig $INTERFACE | grep "TX bytes" | cut -d":" -f2 | cut -d" " -f1`
eth0_rx_kb=`expr $eth0_rx '/' 1024`
expr $eth0_rx_kb - `cat /tmp/eth0_rx.zab`
echo $eth0_rx_kb > /tmp/eth0_rx.zab
exit 0
}
#FREE RAM FUNCTION
ram() {
ram=`free -mt | grep + | cut -d : -f 2 | tail -c5`
echo $ram
exit 0
}
#DISK USAGE FUNCTION
dsk() {
if [ -n $VOLUME ]; then
VOLUME="/dev/hda1"
fi
echo `df -h | grep $VOLUME | tr -s " " | cut -d " " -f 5 | cut -d % -f 1`
}
while getopts "tri:mdv:h" my_opt; do
case $my_opt in
t ) tx;;
r ) rx;;
i ) INTERFACE=$OPTARG;;
m ) ram;;
d ) dsk;;
v ) VOLUME=$OPTARG;;
h ) echo "
USAGE:
-t -> KB transmitted on specified interface since last run. Defaults to eth0.
-r -> KB recieved on specified interface since last run. Defaults to eth0.
-i -> Specify interface to track. Used with -t and -r.
-m -> Total ammount of free ram available on system, including cached ram.
-d -> Percentage of space available on specified partion. Defaults to /dev/hda1
-v -> Specify volume. Use with -d.
"
exit 1;;
esac
done
#ZABBYTES 2.0
#This is a rewrite of some of the funcitons already available in zabbix, but it returns numbers that are easier to read at a glance
#on graphs. It also provided me with a chance to work on my weak shell scripting skills. Anyone is allowed to do
#whatever they want this. Go ahead and tell your boss you wrote it. He'll likely chide you for your sub-par scritping abilities. ;-)
#Written by Brian Warsawsky for use with Zabbix.
#Thanks, Alexi and Zabbix team, for making this awesome program. You guys kick ass!
#NETWORK TX FUNCTION
tx() {
if [ -n $INTERFACE ]; then
INTERFACE=eth0
fi
eth0_tx=`/sbin/ifconfig $INTERFACE | grep "TX bytes" | cut -d":" -f3 | cut -d" " -f1`
eth0_tx_kb=`expr $eth0_tx '/' 1024`
expr $eth0_tx_kb - `cat /tmp/eth0_tx.zab`
echo $eth0_tx_kb > /tmp/eth0_tx.zab
exit 0
}
#NETWORK RX FUNCTION
rx() {
if [ -n $INTERFACE ]; then
INTERFACE=eth0
fi
eth0_rx=`/sbin/ifconfig $INTERFACE | grep "TX bytes" | cut -d":" -f2 | cut -d" " -f1`
eth0_rx_kb=`expr $eth0_rx '/' 1024`
expr $eth0_rx_kb - `cat /tmp/eth0_rx.zab`
echo $eth0_rx_kb > /tmp/eth0_rx.zab
exit 0
}
#FREE RAM FUNCTION
ram() {
ram=`free -mt | grep + | cut -d : -f 2 | tail -c5`
echo $ram
exit 0
}
#DISK USAGE FUNCTION
dsk() {
if [ -n $VOLUME ]; then
VOLUME="/dev/hda1"
fi
echo `df -h | grep $VOLUME | tr -s " " | cut -d " " -f 5 | cut -d % -f 1`
}
while getopts "tri:mdv:h" my_opt; do
case $my_opt in
t ) tx;;
r ) rx;;
i ) INTERFACE=$OPTARG;;
m ) ram;;
d ) dsk;;
v ) VOLUME=$OPTARG;;
h ) echo "
USAGE:
-t -> KB transmitted on specified interface since last run. Defaults to eth0.
-r -> KB recieved on specified interface since last run. Defaults to eth0.
-i -> Specify interface to track. Used with -t and -r.
-m -> Total ammount of free ram available on system, including cached ram.
-d -> Percentage of space available on specified partion. Defaults to /dev/hda1
-v -> Specify volume. Use with -d.
"
exit 1;;
esac
done
Thanks Alexi and company, for making such and awesome product.
Brian