Git Product home page Git Product logo

zabbix-disk-performance's Introduction

zabbix-disk-performance

Zabbix template for collecting IO statistics

With this template you can collect different disk statistics.

Bytes/Sec Merged Ops/Sec Overview

Installation

To install, copy userparameter_diskstats.conf to /etc/zabbix/zabbix_agentd.d/userparameter_diskstats.conf and lld-disks.py to /usr/local/bin/lld-disks.py. Do not forget to mark it executable.

# diskstats user parameters config
sudo mkdir -p /etc/zabbix/zabbix_agentd.d/
sudo wget https://raw.githubusercontent.com/grundic/zabbix-disk-performance/master/userparameter_diskstats.conf -O /etc/zabbix/zabbix_agentd.d/userparameter_diskstats.conf

# low level discovery script
sudo wget https://raw.githubusercontent.com/grundic/zabbix-disk-performance/master/lld-disks.py -O /usr/local/bin/lld-disks.py
sudo chmod +x /usr/local/bin/lld-disks.py

userparameter_diskstats.conf is user parameters for Zabbix. lld-disks.py is low level discovery script for enumerating disks of your system.

After that restart zabbix-agent sudo service zabbix-agent restart

Go to Zabbix's web interface, Configuration->Templates and import Template Disk Performance.xml. After that you should be able to monitor disk activity for all your disks.

Please note, that items and graphs are created for each disk/partition individually using discovery script, so do not expect to find them under usual configuration -- they would be in Discovery rules section:

Discovery Rules

Low level discovery will list your RAID devices, and LVM volumes, but LVM volumes will be mapped with their device-mapper ID, not the pretty names.

Using without User Parameters

Zabbix have standard parameters for monitoring disk io: vfs.dev.read and vfs.dev.write with several types:

  • sectors
  • operations
  • sps
  • ops

Template have this values configured, but disabled by default.

Testing

To test that everything work use zabbix_get (from some time this is in it's own package, so do apt-get/yum install zabbix-get):

# view result of low level discovery
zabbix_get -s 127.0.0.1 -k "custom.vfs.discover_disks"
# view statistics for 'sda' disk
zabbix_get -s 127.0.0.1 -k "custom.vfs.dev.write.sectors[sda]"

zabbix-disk-performance's People

Contributors

beli-sk avatar grundic avatar rorybrowne avatar spindel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabbix-disk-performance's Issues

Not work with Zabbix-agent2 on Ubuntu20,Debian10

Hi!
Zabbix-server 5.2.3 zabbix-agent2 5.2.3 Ubuntu20 and Debian10
It not work with Zabbix-agent2 on Ubuntu20,Debian10.
I don't see in Zabbix any error in the host. But any items say Preprocessing failed for: 0 0 0 0 0 0 0 0 0 0 ...

  1. Failed: cannot calculate delta (speed per second) for value of type "string": cannot convert value to numeric type
    ok
    Preprocessing failed for: awk: program limit exceeded: maximum number of fields size=32767..FILENAME="/sys/class/block/sda/...
  2. Failed: cannot calculate delta (speed per second) for value of type "string": cannot convert value to numeric type

I seem the problem is in AWK. How to resolve it?

Disk statistics reporting very high KOPS

The disk stats being reported seem to be very very high for operations per second
image

This is a raided set of 7200 rpm disks 40,000 operations a second seems high

Is this a calculation error or zabbix doing something strange?

Not able to retreive data

[root@Zabbix zabbix-disk-performance-master]# zabbix_get -s 192.168.xxx.xxx -k "custom.vfs.dev.write.sectors[sda]"
52084

I am able to return the data from the README, but when template is applied to a host.. no new items or graphs appear

should i see anything when i run the command:
zabbix_get -s 192.168.xxx.xxx -k "custom.vfs.discover_disks"

?

edit: I am seeing an error in the discovery rule: "Value should be a JSON object"

Zabbix Agent 4.0 incompatibility

I use zabbix-agent 4.0 on SLES 12 SP 3 and zabbix-disk-performance does not work.

I had to downgrade to version 3.0 of zabbix-agent to correct the problem.

In Ubuntu Machine Not working

Hi,

Thanks for the project.

I am unable to collect the metrics from ubuntu machine and discovery rules are failed for disk performance.
But I am using this project in many centos instance it is working fine and Please refer the attached screenshot for your reference.
zabbix-disk

For your reference:

root@ROOT-ABC-ubuntu-01-P:/home/ubuntu# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

zabbix 3.2 disk read data none

[root@monitor zabbix]# zabbix_get -s 127.0.0.1 -k "custom.vfs.dev.read.sectors[sda2]"
471815

read data display ok

but. zabbix web page lastdata or graph read data not displayed ㅠㅠ

help

Issue with devices like: cciss!c0d0p6]

Hello
Seems there is issue with getting data from devices like: cciss!c0d0p6

./zabbix_get -s 127.0.0.1 -k "custom.vfs.dev.write.sectors[cciss!c0d0p6]"
-bash: !c0d0p6]": event not found

can it be resolved ?

import errors

hi, i encountered these errors when importing template:

mb_strlen() expects parameter 1 to be string, array given [conf.import.php:130 → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CAPIObject->create() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CDiscoveryRule->create() → CDiscoveryRule->createReal() → DB::insert() → DB::checkValueTypes() → zbx_strlen() → mb_strlen() in /usr/share/zabbix/include/func.inc.php:955]
Array to string conversion [conf.import.php:130 → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CAPIObject->create() → CAPIObject->call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CDiscoveryRule->create() → CDiscoveryRule->createReal() → DB::insert() → implode() in /usr/share/zabbix/include/classes/db/DB.php:450]
Error in query [INSERT INTO items (name,type,snmp_community,snmp_oid,delay,status,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,delay_flex,params,ipmi_sensor,authtype,username,password,publickey,privatekey,port,filter,lifetime,description,key
,trapper_hosts,hostid,flags,value_type,data_type,interfaceid,itemid) VALUES ('Disk discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'30','','custom.vfs.discover_disks','','10109','1','4','0',NULL,'23952')] [Unknown column 'Array' in 'field list']
SQL statement execution has failed "INSERT INTO items (name,type,snmp_community,snmp_oid,delay,status,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,delay_flex,params,ipmi_sensor,authtype,username,password,publickey,privatekey,port,filter,lifetime,description,key
,trapper_hosts,hostid,flags,value_type,data_type,interfaceid,itemid) VALUES ('Disk discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'30','','custom.vfs.discover_disks','','10109','1','4','0',NULL,'23952')".

FreeBSD(FreeNAS) support?

Your counters is exactly what i need. Works perfectly on CentOS.

But i try to use in FreeBSD and get a error.

Is possible make this avaliable to FreeBSD?

Or can tell me how can'i do it?

remove "-e" from userparameter_diskstats.conf

Hello,

You should remove "-e" option in awk under userparameter_diskstats.conf to get correct data from /sys/class/block/$1/stat . Auto-discovery script works without any issues.

The template isn't compatible with zabbix 2.4

I try to import this template into 2.4.4, but the items show 0.

Template Disk Performance Applications (1) Items (0) Triggers (0) Graphs (0) Screens (0) Discovery (1) Web (0) - -

sh: 1: /usr/local/bin/lld-disks.py: not found

Hi,
I was install it on ubuntu servers and it works.
Actualy I Install it on Debian9 and i get error:
sh: 1: /usr/local/bin/lld-disks.py: not found
But file exist on this localization and it have a executable permission.
How can I fix this problem?

Locally on machine it works (i pasting command from error)

Doing:
ssh [email protected] python3 /usr/local/bin/lld-disks.py
It works too

Unfortunately in logs I don't' see nothing special

Export template to version 3.0

Please export the template to zabbix 3.0.
When imported your template just Applications Items 1| Triggers 0| Graphics 0 |Screens 0|Discovery 1| Web 0| came ....

From this comment.

Rocky-linux 8.5 Ramdrive monitoring

Hello,
I use the disks for monitoring on my rocky-linux 8.5 server. I can see the SDA mount disks, but I cannot monitor the RAM drive. This is the result when I run it manually with zabbi_get.

Does anyone know anything about the problem?

zabbix_get -s 127.0.0.1 -k "custom.vfs.discover_disks"
File "/etc/zabbix/scripts/lld-disks.py", line 9
devices = (device for device in os.listdir("/sys/class/block")
^
IndentationError: unindent does not match any outer indentation level

Thanks.

ZBX_NOTSUPPORTED: Unsupported item key.

Hallo,
first thank you very much for the super template.

I have followed the guide and all the files installed.
But when i tried to test the command " zabbix_get -s 127.0.0.1 -k "custom.vfs.discover_disks"",
i got

ZBX_NOTSUPPORTED: Unsupported item key.

Would you please tell me how to solve the problem?
My Sever is running debian and zabbix 2.4. Just upgraded from 2.2
Thanks.

Agent fails to start

After installing the config and script, the Zabbix Agent fails to start. If I remove the two items, the agent starts fine. Any ideas?

Many thanks

Issues with python2 on RH5

Hi,

I need some help here. I had to change "import json" to "import simplejson as json", RH5 doesn't have json installed by default, so I've installed simplejson. But now I'm getting a different error:


Traceback (most recent call last):
File "/usr/local/bin/lld-disks.py", line 12, in ?
data = [{"{#DEVICENAME}": device} for device in devices]
File "/usr/local/bin/lld-disks.py", line 10, in
devices = (device for device in os.listdir("/sys/block")
NameError: global name 'any' is not defined

Running on....

[root@srv094 tmp]# lsb_release -a
Description: Red Hat Enterprise Linux Server release 5.11 (Tikanga)

and...

[root@srv094 tmp]# python -V
Python 2.4.3

Someone can modify this python code to run on Python 2.4 ? I can't upgrade this server now, it is a production server.

Error during discovery on Ubuntu 20.04

I've got this application running on a couple dozen Ubuntu 14-18 servers, but the two I've just spun up are on Ubuntu 20.04 and I'm getting the following error during discovery:

Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sh: 1: /usr/local/bin/lld-disks.py: not found'

Has anybody else ran into this issue? Running Zabbix 5.0.1

Return data from script

Hi,

Today I found your script for monitoring disk use zabbix, but I have some little problem..

[root][db1]: cat /proc/diskstats | grep xvdb | head -1 | awk '{print $$4}'

[root][db1]: cat /proc/diskstats | grep xvdb | head -1 | awk '{print $4}'
147084623

First command doesn't return any data.. in second I delete one $ from print and I get some data.. but when I do this modification all items in zabbix I saw as unsupported..
Have you any ideas why is that? My OS is CentOS 5.9 x64, zabbix-agent 2.0.9 and zabbix-server 2.2.0.

Not work Ubuntu 16.04 Read items

I use Ubuntu 16.04 LTS Zabbix-server|agent 3.4
For my plugin work. Discovery work well. But not work Read Items(I dont see correct value)! Write work well and show metric correctly.
It is a bug? How to resolv?
Ubuntu 17 work well all items. Maybe for 16 need installing somebody dependency app?

I have a problen with the graphs

i can't see de graphs.

i copy all file and import the XML, i do the tests in terminal with zabbix_get and recive data but i cant see the graphs in Dashboard

issue on aws

we use aws cloud, this script found xvda and xvda1, actually this two is for one disk.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.