I’ve decided to use this plugin, check_iftraffic64.pl for network card monitoring (for Linux)
Plugin name : check_iftraffic64.pl
# check_iftraffic.pl – Nagios(r) network traffic monitor plugin
# Copyright (C) 2004 Gerd Mueller / Netways GmbH
# Version .76
My nagios version is 4.1.1 running on CentOS 7.2.1511 x64.
In order for the plugin to work i had to install perl Net::DNS.
yum install perl-Net-DNS.x86_64
Manually running the plugin shows valid data :
OK - Average IN: 1.32KB (0.00%), Average OUT: 1.80KB (0.00%)Total RX: 73.72GBytes, Total TX: 118.96GBytes|inUsage=0.00%;85;98 outUsage=0.00%;85;98 inBandwidth=1320.86B outBandwidth=1796.35B inAbsolut=73715474187c outAbsolut=118964135441c
Also, the plugin creates a traffic folder with statistics in /usr/local/nagios/libexec/traffic
After setting the service and commands directives in nagios, the output of Status Information was : (No output on stdout) stderr:
After digging a while, i saw that the traffic folder was created with root:root as owner and group. Also the stats files in this folder were untouched. They were only changing when manually running the script. Changing the owner and group to nagios and restarting nagios, solved the problem and stats files were updated.