Showing posts with label zabbix_server. Show all posts
Showing posts with label zabbix_server. Show all posts

Friday, 1 April 2016

Zabbix: Received value is not suitable for value type [Numeric (unassigned)] and data type [Decimal]

Recently I was told one of our monitoring item is broken.
At first I thought maybe zabbix server was busy, but only one host is having issue.
My second thought: maybe that host was busy and zabbix agent couldn't return value. But all other items are working fine, only item "product_diff" is broken.
I tried zabbix_get manually, I could get value without problem.
$ zabbix_get -s centos-1.local.vb -k product_diff
-398
$ zabbix_get -s centos-1.local.vb -k product_diff
-205
And in the zabbix_server.log, I saw entries like this:
 31168:20160322:095648.251 item "centos-1.local.vb:product_diff" became not supported: Received value [-299] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
So centos-1.local.vb returned negative values while zabbix server was expecting Numeric (unassigned).

It turns out that, we configured zabbix to monitor product_diff on centos-1.local.vb, initially we were only interested in the absolute difference. But recently production team felt the real difference makes more sense to them. So they replaced the script on centos-1.local.vb.
But inside zabbix server, the item configuration was not changed

In item configuration, product_diff is configured like this:










I updated "Type of Information" from "Numeric (unassigned)" to "Numeric (float)"








Monitoring should work now, but it doesn't, and I still see errors in zabbix_server.log
In zabbix, all the configurations are kept in database, so maybe the changes made on web UI didn't update database.
Logging in to zabbix database, check the item table:
MYSQL> select key_, value_type from items where key_ = 'product_diff';
+---------------------------+
| key_         | value_type |
+---------------------------+
| product_diff |         3  |
+--------------+------------+

In zabbix value_type 3 represents Numeric (unassigned), 0 represents Numeric (float). So we need to update this table, setting value_type to 0.
MYSQL> update items set value_type = 0 key_ = 'product_diff';

After that, monitoring started working again!

Tuesday, 10 September 2013

How to install Zabbix agent and monitor remote linux servers

I installed Zabbix server in my previous post: http://linuxscripter.blogspot.com/2013/09/how-to-install-zabbix-server-on-linux.html
To monitor remote servers, we can install Zabbix agent.
Installing Zabbix agent is quite straight forward

Here are my installation steps:
1. create user account for zabbix
# useradd zabbix
2. download current stable version zabbix-2.0.8.tar.gz from www.zabbix.com
3. configure and install zabbix agent
# tar -zxpf zabbix-2.0.8.tar.gz
# cd zabbix-2.0.8
#  ./configure --enable-agent --prefix=/usr/local/zabbix
# make install
4. modify /usr/local/zabbix/etc/zabbix_agentd.conf
In previouse post, we installed zabbix server on 192.168.100.100, so modify the Server parameter
Server=192.168.100.100
5. restart zabbix_agentd to reload the new configuration file
now we can monitor this host from zabbix server.

To monitor remote host, all the configuration are done in the Zabbix web interface.
1. open web browser, go to http://zabbix-server/zabbix
2. Configuration -> Hosts -> Create host
Enter the host name, IP address, choose "Linux servers" as the host group.


3. After saving, you will see the host linux-1 is monitored by zabbix now.


 4. At the monitoring dashboard, you will see issues are shown in different colors


Reference: https://www.zabbix.com/documentation/2.0/manual/installation/install#from_the_sources