Giter VIP home page Giter VIP logo

zabbix_scripts's Introduction

zabbix_scripts

This is a collection of scripts for use with Zabbix.

zbxwmi

Connects to a Windows server using WMI to discover and collect WMI data. It uses Low-Level Discovery and is agentless.

zbxwmi must be installed on a Zabbix server or proxy and depends on wmic.

Installation

  • Create a Windows user with WMI permissions
  • Install wmic. It can be installed from rpmforge or compiled from source, http://dev.zenoss.org/svn/tags/wmi-1.3.14/
  • Clone this repository into /usr/lib/zabbix/externalscripts/
  • Make zabbix the owner of the zbxwmi script and add execute permissions
  • Install the dependencies :
pip install -r requirements.txt
  • Import the template and set the required macros.

Usage

Usage:
  zbxwmi [-d] get <host> <item> <class> [-f <filter>] [-z <server>] [-D <domain>] [-U <username>] [-P <password] [-o <logfile>]
  zbxwmi [-d] (bulk|discover) <host> <keys> <items> <class> [-f <filter>] [-z <server>] [-D <domain>] [-U <username>] [-P <password] [-o <logfile>]
  zbxwmi [-d] <host> <keys> <items> <class> [-f <filter>] [-z <server>] [-D <domain>] [-U <username>] [-P <password] [-o <logfile>]
  zbxwmi --help
  zbxwmi --version

Actions

get: query a specific WMI item.

zbxwmi get SVR1 FreeSpace "Win32_LogicalDisk" -f "MediaType = 12 AND Name = 'C:'"
4079554560

discover : outputs a JSON-formatted output for LLD discovery.

zbxwmi discover SVR1 Name Name,Size,FreeSpace "Win32_LogicalDisk" -f "MediaType = 12"
{
    "data": [
        {
            "{#WMIINDEX0}": "C:"
        },
        {
            "{#WMIINDEX0}": "D:"
        },
        {
            "{#WMIINDEX0}": "E:"
        }
    ]
}

bulk: bulk sends item values to Zabbix using the Zabbix sender protocol.

zbxwmi bulk SVR1 Name Name,Size,FreeSpace "Win32_LogicalDisk" -f "MediaType = 12"

both (default action): combines the discover and bulk actions to create the discovered items in Zabbix using LLD and get their values.

zbxwmi SVR1 Name Name,Size,FreeSpace "Win32_LogicalDisk" -f "MediaType = 12" -D MYDOMAIN -U wmiuser -P secret
{
    "data": [
        {
            "{#WMIINDEX0}": "C:"
        },
        {
            "{#WMIINDEX0}": "D:"
        },
        {
            "{#WMIINDEX0}": "E:"
        }
    ]
}

A sample template to monitor Windows services is provided. Don't forget to use a secure Windows account to query your hosts (a domain admin will work but it's not recommended). You can add the credentials into the script if you don't want to display them into the Zabbix frontend.

zabbix_scripts's People

Contributors

dav3860 avatar

Watchers

kinboyw avatar

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.