Ad Widget

Collapse

Host disk/volume/quota monitoring-graphs LLD

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmarkwitzz
    Senior Member
    • Jan 2011
    • 106

    #1

    Host disk/volume/quota monitoring-graphs LLD

    This solution is based on zabbix 2.0 api and LLD which is only available in zabbix 2.0

    The template included uses active checks. Your zabbix agent must be configured for active checks otherwise the server won't receive any data..

    Many thanks to Bruce Allen for creating and maintaining SmartMonTools.

    Description

    This solutions gives you complete monitoring of disks, volumes and quotas. The template uses LLD, meaning you don't have to configure any settings in the template, it automatically discovers and monitors all disks, volumes and quotas on the host.

    You get monitoring for the following:
    • Eventlog entries generated for disk errors, bad sectors, controller errors etc.
    • Performance alerts when byte/sec and latency limits are reached
    • Disk bytes/sec and latency
    • Disk SMART health and temperature
    • Quota free space
    • Volume bytes/sec, free space and status
    • Volume software raid (windows disk management) health


    You also get several graphs like so:






    [B]Usage/B]

    Download the archive, extract the XML template, import it into the frontend and link the hosts to it.

    Copy the vbs scripts to your zabbix agent folder and configure the following lines in your zabbix_agentd.conf file, replacing the path in the UserParameter with your zabbix agent installation path, restart the agent.

    Code:
    #system info
    UserParameter = system.info[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_system_info.vbs" //Nologo "$1" "$2"
    #system discovery
    UserParameter = system.discovery[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_system_discovery.vbs" //Nologo "$1"
    #disk smart
    UserParameter = disk.smart[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_disk_smart.vbs" //Nologo "$1" "$2"
    #volume raid
    UserParameter = volume.raid[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_volume_raid.vbs" //Nologo "$1" "$2"
    #quota
    UserParameter = quota[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_quota.vbs" //Nologo "$1" "$2"
    #eventlog query
    UserParameter = eventlog.query[*],cscript "C:\Program Files\Zabbix agent\zabbix_win_eventlog.vbs" //Nologo "#1" "#2"
    # allow weird chars in userparameters arguments
    UnsafeUserParameters=1
    Replace "#1" "#2" with the correct form using $, as zabbix forum won't let me post any more dollar signs for some reason.

    Download the perl scripts to you zabbix server, edit them, specifically the parameters below, and cron them (I personally user cron.hourly).

    Code:
    	$user = "Admin"; ### username
    	$password = "zabbix"; ### password	
            $url = "http://127.0.0.1/api_jsonrpc.php"; ### intenal zabbix url
    The scripts connect using $user and $password via json api (so the user needs API access, check that in the frontend) and creates the following graphs for all hosts linked to "WIN Disks" template.
    For a detailed explanation of how the scripts work you can view the following post: http://zabbix.com/forum/showthread.php?t=26678
    • WIN Disk "ALL" bytes/sec stack
    • WIN Disk "ALL" latency normal
    • WIN Disk "ALL" latency stack
    • WIN Disk SMART "ALL" temparature
    • WIN Quota "ALL" bytes free stack
    • WIN Volume "ALL" bytes free stack
    • WIN Volume "ALL" bytes/sec stack


    Download SmartMonTools from smartmontools.sourceforge.net and copy the executable to the zabbix agent installation path, renaming it to smartctl.exe if needed.

    Gotchas

    The template triggers thresholds like volume critical space can be edited by modifying the user macros in the template.
    The following macros and their default values are included:
    • {$DISKBPS_CRIT} = 20MB/s disk bytes/sec total
    • {$DISKBPS_HIGH} = 10MB/s
    • {$DISKLATENCY_CRIT} = 80 ms/io disk latency
    • {$DISKLATENCY_HIGH} = 40 ms/io
    • {$QUOTA_CRIT} = 2GB quota free critical
    • {$QUOTA_DEPL} = 500MB quota free depleted
    • {$QUOTA_LOW} = 5GB quota free low
    • {$VOLBPS_CRIT} = 20MB/s volume bytes/sec total
    • {$VOLBPS_HIGH} = 10MB/s
    • {$VOLFREE_CRIT} = 2GB volume free critical
    • {$VOLFREE_DEPL} = 500MB volume a free depleted
    • {$VOLFREE_LOW} = 5GB volume free low


    If you are using any other of my templates, make sure your hosts only have one active instance of the WIN Eventlog OOP item. If there is more than one, disable the extra items.
    The eventlog triggers send an alert containing information on the most recent events logged. For these to show up in the alert make sure you include the following macros in the alert message:

    Eventlog info: {ITEM.LASTVALUE}

    If you have any issues importing this template, please upgrade to zabbix 2.0.2 (not released at the date of this post) and php 5.3 or higher.

    Update 1

    I can confirm that importing templates with Discovery Rules is broken in zabbix 2.0.1 and will be fixed in zabbix 2.0.2.
    A partial fix for this, until zabbix 2.0.2 is released, can be achieved by SSH to your zabbix server and making the following changes to these files:
    • Edit /var/www/html/include/classes/import/formatters/C20ImportFormatter.php
    • Search for getDiscoveryRules function
    • Modify the line:
    • if (!empty[$host['discovery_rules'])) {
    • with:
    • if (!empty[$template['discovery_rules'])) {


    This will fix importing Discovery rules, item prototypes and trigger prototypes. Graph prototypes importing will still be broken, as they will get imported directly into the template, not in the discovery rules.

    Update 2

    Decreased eventlog query time to 300s.

    Update 3

    Fixed the scripts. Please download the archive again.
    Attached Files
    Last edited by mmarkwitzz; 31-07-2012, 14:44.
  • ehermouet
    Member
    • May 2011
    • 50

    #2
    very nice ))

    for this moment it don't work for me... when i do my cron nothing ...just said server group () but not like process where it do graph create for host...

    here not...

    zbx_notsupported on zabbix server
    supported with agent 2.0 not 1.8 but same problem with graph. item are present but no graph yet
    Last edited by ehermouet; 31-07-2012, 12:36.

    Comment

    • ehermouet
      Member
      • May 2011
      • 50

      #3
      i see on template link template where template = "WIN windows" it's Win disk no ?

      Comment

      • mmarkwitzz
        Senior Member
        • Jan 2011
        • 106

        #4
        Originally posted by ehermouet
        i see on template link template where template = "WIN windows" it's Win disk no ?
        My bad. You are right, it should be "WIN Disks" instead of "WIN Windows". I have modified and re-uploaded the archive. Please be careful when editing the scripts, I think the check is !case sensitive!

        All these posts I made are extracted from a single template I use internally named "WIN Windows". When making the archive for this post I forgot to replace the name in the scripts.

        Comment

        Working...