Reputation: 43
I have been using Zabbix for about 2 weeks and think it's great.
My set up: Server: Zabbix 2.2 Appliance Clients: Ubuntu 12.04 Precise Server 64bit
I have installed the Zabbix agent (zabbix-agent_2.2.0-1+precise_amd64.deb ) using dpkg and normally after an hour - discovery populates more items for the servers and this includes Network interfaces and utilisation.
I have 1 server where this has not worked. All other data, CPU, memory, filesystems have come in but NOT network.
I have been trying to use the agent command to troubleshoot:
$ zabbix_agentd -t "system.cpu.load[all,avg1]"
system.cpu.load[all,avg1] [d|0.240000]
Where as the network fails:
$ zabbix_agentd -t "net.if.in[eth0]"
net.if.in[eth0] [m|ZBX_NOTSUPPORTED]
But if I run it as sudo it works...
$ sudo zabbix_agentd -t "net.if.in[eth0]"
[sudo] password for jsm:
net.if.in[eth0] [u|27166807]
Do I have to change the permissions of something to get this working?
I've posted on the Zabbix forum - and no new ideas have come forward. Thank you
Further info on the host where this is happening: This 1 server is a little different. It is a hosted server, where you select the OS you want and they build it and send you root credentials to then use as you wish.
I have noticed on this server that ifconfig does not give the usual output, instead it replies with: Warning: cannot open /proc/net/dev (No such file or directory). Limited output.
If I run sudo ifconfig then the output is normal: eth0 Link encap:Ethernet HWaddr 00:1c:c0:ec:..... etc
Other info on the server: $ zabbix_agent -V Zabbix agent v2.2.0 (revision 40163) (12 November 2013) Compilation time: Nov 12 2013 12:23:06
$ sudo groups zabbix zabbix : zabbix
$ sudo ls -als /proc/net/dev 0 -r--r--r-- 1 root root 0 Jan 28 11:48 /proc/net/dev
$lsb_release -irc Distributor ID: Ubuntu Release: 12.04 Codename: precise
Upvotes: 1
Views: 9824
Reputation: 43
In the end I did get this working by booting a non GRS kernel as described here. Thanks Michael for the nudges.
http://neuro.me.uk/blog/2009/09/20/revert-to-standard-ubuntu-kernel-on-ovh-or-kimsufi-servers
Short version:
apt-get install linux-image-server
mkdir ~/ovh.d
mv /etc/grub.d/06_OVHkernel ~/ovh.d
update-grub
shutdown -r -f now
And now the stats come through fine.
Upvotes: 1
Reputation: 1822
I you don't want to change your kernel :
Create a new script directory :
mkdir /etc/zabbix/root
chown root.zabbix /etc/zabbix/root
chmod 750 /etc/zabbix/root
Add this line to /etc/sudoers :
zabbix ALL=(ALL) NOPASSWD: /etc/zabbix/root/*.sh
Create /etc/zabbix/root/net-if-in.sh :
cat /proc/net/dev | grep $INTERFACE | awk '{ print $2; }'
Create /etc/zabbix/root/net-if-out.sh :
cat /proc/net/dev | grep $INTERFACE | awk '{ print $10; }'
Add this 2 lines to zabbix_agentd.conf :
UserParameter=net-if-in[*], sudo /etc/zabbix/root/net-if-in.sh $1
UserParameter=net-if-out[*], sudo /etc/zabbix/root/net-if-out.sh $1
Test it :
sudo -u zabbix zabbix_agentd -t "net-if-in[eth0]"
Restart the agent, add the new items in zabbix server !
Upvotes: 1
Reputation: 3577
This has nothing to do with zabbix as you can clearly see. This is a "problem" with the server and not even with the "OS" but with the platform. What you describe seems to be some pseudo virtualization container like OpenVZ or some weird kernel patch. I try my best to avoid these so can't advice anything specific. But start from getting the information about the platform.
Edit: the "weird patch" appears to be the grsecurity.
Upvotes: 0