Code Monkey home page Code Monkey logo

virbix's Introduction

virbix

KVM Monitoring

This script is part of a monitoring solution that allows to monitor several services and applications.

For more information about this monitoring solution please check out this post on my site.

Star History

Star History Chart

Dependencies

Packages

  • ksh
  • xmllint

Debian/Ubuntu

~# sudo apt install ksh xmllint
~#

Red Hat

~# sudo yum install ksh
~#

Deploy

Default variables:

NAME VALUE
LIBVIRT_URI qemu:///system

Note: these variables has to be saved in the config file (virbix.conf) in the same directory than the script.

Zabbix

~# git clone https://github.com/sergiotocalini/virbix.git
~# sudo ./virbix/deploy_zabbix.sh -u "qemu:///system"
~# sudo systemctl restart zabbix-agent

Note: the installation has to be executed on the zabbix agent host and you have to import the template on the zabbix web. The default installation directory is /etc/zabbix/scripts/agentd/virbix

Usage

~# /etc/zabbix/scripts/agentd/virbix/virbix.sh -s domain_list -j DOMID:DOMNAME:DOMUUID:DOMTYPE:DOMSTATE
{
   ...
}
~#

virbix's People

Contributors

sergiotocalini 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

Watchers

 avatar  avatar  avatar  avatar  avatar

virbix's Issues

Used space: 0B

What's wrong - Zabbix server shows me:
Used space: 0B
Free space: 0B

What should I look at?

Template does not load. Zabbix 4.0.18.

I am trying to load a template but I have an error

Details Import failed

Cannot read XML: (41) Specification mandate value for attribute data-pjax-transient [Line: 50 | Column: 90].

Zabbix 4.0.18.

Problem on debian 9

I just installed according to instruction page, but I get following error for all 3 discovery rule:

Cannot create item: item with the same key "virbix[domain_check, {#DOMUUID}, state]" already exists.

Cannot create item: item with the same key "virbix[net_check, {#NETUUID}, active]" already exists.

Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, size_free]" already exists.
Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, size_used]" already exists.
Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, state]" already exists.

can you help me to get it working?
Zabbix version: 4.2
thanks

Sudo

How to adjust sudo for operation?

Zabbix v5 compatability

Hi, is v5 supported? We can't seem to get it working with v5.0.1. When we try to run virbix.sh manually, we get ZBX_NOTSUPPORTED.

Does not seem to work with Zabbix 6.4.2

SUMMARY

I added the template to my zabbix 6.4.2 server. It imported successfully. I then cloned the git repo and proceeded to run the deploy script on an agent running libvirtd. The deployment script created /etc/zabbix/zabbix_agentd.d and put a file in there. The only problem with that being ... I'm running zabbix_agent2, which uses /etc/zabbix/zabbix_agent2.d instead. I moved the file to the correct location and restarted zabbix-agent2.

Nothing is ever discovered. I tried manually running the discovery rules, and for all three of them the response is { "data":[ ] }

The agent logs are silent. The server log just has info about the discovery rules becoming not supported and then about 20 seconds later becoming supported.

OS / ENVIRONMENT / Used docker-compose files

Not using docker for zabbix. I installed using the zabbix APT repo onto Ubuntu Server 22.04.

The monitored system:

elyograg@smeagol:/etc/zabbix$ dpkg -l | grep zabbix
ii  zabbix-agent2                              1:6.4.2-1+ubuntu22.04                         amd64        Zabbix network monitoring solution - agent
ii  zabbix-release                             1:6.4-1+ubuntu22.04                           all          Zabbix official repository configuration
ii  zabbix-sender                              1:6.4.2-1+ubuntu22.04                         amd64        Zabbix network monitoring solution - sender
elyograg@smeagol:/etc/zabbix$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy
elyograg@smeagol:/etc/zabbix$ uname -a
Linux smeagol 6.1.0-1012-oem #12-Ubuntu SMP PREEMPT_DYNAMIC Tue May  9 17:12:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

The zabbix server:

elyograg@boromir:~$ dpkg -l | grep zabbix
ii  zabbix-agent2                         1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - agent
ii  zabbix-apache-conf                    1:6.4.2-1+ubuntu22.04                   all          Zabbix network monitoring solution - apache configuration for front-end
ii  zabbix-frontend-php                   1:6.4.2-1+ubuntu22.04                   all          Zabbix network monitoring solution - PHP front-end
ii  zabbix-get                            1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - get
ii  zabbix-js                             1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - js
ii  zabbix-release                        1:6.4-1+ubuntu22.04                     all          Zabbix official repository configuration
ii  zabbix-sender                         1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - sender
ii  zabbix-server-mysql                   1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - server (MySQL)
ii  zabbix-sql-scripts                    1:6.4.2-1+ubuntu22.04                   all          Zabbix network monitoring solution - sql-scripts
ii  zabbix-web-service                    1:6.4.2-1+ubuntu22.04                   amd64        Zabbix network monitoring solution - web-service
elyograg@boromir:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy
elyograg@boromir:~$ uname -a
Linux boromir 6.1.0-1012-oem #12-Ubuntu SMP PREEMPT_DYNAMIC Tue May  9 17:12:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
CONFIGURATION

The only thing changed in the server config file is info about the database. On the agents, I actually don't change the main config file, I just add things to zabbix_agent2.d.

elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ ll
total 52
drwxr-xr-x 3 root     root     4096 May 23 21:52 ./
drwxr-xr-x 4 root     root     4096 May 23 22:04 ../
-rw-r--r-- 1 root     root       23 Aug 29  2021 allow_key.conf
-rw-r--r-- 1 root     root       64 Nov 22 17:54 pacemaker.conf
drwxr-xr-x 2 root     root     4096 Apr 25 14:11 plugins.d/
-rw-r--r-- 1 root     root      814 Dec 23  2021 userparameter_apcupsd.conf
-rw-r--r-- 1 root     root      131 Mar  9  2022 userparameter_megaraid.conf
-rw-rw-r-- 1 elyograg elyograg  304 May 23 21:44 virbix.conf
-rw-r--r-- 1 root     root       60 Feb 19 11:49 zabbix_lsof.conf
-rw-r--r-- 1 root     root      100 Sep  1  2021 zabbix_postfix.conf
-rw-r--r-- 1 root     root       57 Jan 11  2022 zfs.conf
-rw-r--r-- 1 root     root       30 Aug  9  2021 zz-hostname.conf
-rw-r--r-- 1 root     root      153 May 23 08:58 zz-server.conf
elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ cat zz-hostname.conf 
Hostname=smeagol.elyograg.org
elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ cat zz-server.conf 
Server=boromir.elyograg.org
ServerActive=boromir.elyograg.org
TLSConnect=psk
TLSAccept=psk
TLSPSKFile=/etc/zabbix/secret.psk
TLSPSKIdentity=elyograg.org
STEPS TO REPRODUCE

Import the template on the server and add it to a host.

Deploy to the agent, move the config file to the proper location for zabbix_agent2, restart the agent.

KVM Motioning issue

Hi,

I have installed KVM virbix as per your instructions, but we are getting the error below, please help me to resolve its issue.

Cannot create item: item with the same key "virbix[domain_check, {#DOMUUID}, state]" already exists.
Cannot create item: item with the same key "virbix[net_check, {#NETUUID}, active]" already exists.
Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, size_free]" already exists.
Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, size_used]" already exists.
Cannot create item: item with the same key "virbix[pool_check, {#POOLUUID}, state]" already exists.

I set the sudo access as suggested but the issue is the same.

Thanks
Pradeep

Debian 10 deploy_zabbix.sh

Hi,

I have debian 10 running. The deploy_zabbix.sh script will fail in line number 11.
Debian 10 uses:
/etc/zabbix//zabbix_agentd.conf.d/
instead of:
/etc/zabbix/zabbix_agentd.d/

--- deploy_zabbix.sh 2019-09-02 23:40:04.935621382 +0200
+++ deploy_zabbix.sh.new 2019-09-02 23:40:08.938365913 +0200
@@ -8,5 +8,5 @@
cp -r ${SOURCE_DIR}/virbix/scripts ${ZABBIX_DIR}/scripts/agentd/virbix/
cp ${SOURCE_DIR}/virbix/virbix.conf.example ${ZABBIX_DIR}/scripts/agentd/virbix/virbix.conf
cp ${SOURCE_DIR}/virbix/virbix.sh ${ZABBIX_DIR}/scripts/agentd/virbix/
-cp ${SOURCE_DIR}/virbix/zabbix_agentd.conf ${ZABBIX_DIR}/zabbix_agentd.d/virbix.conf
+cp ${SOURCE_DIR}/virbix/zabbix_agentd.conf ${ZABBIX_DIR}/zabbix_agentd.conf.d/virbix.conf
sed -i "s|LIBVIRT_DEFAULT_URI=.*|LIBVIRT_DEFAULT_URI="${LIBVIRT_URI}"|g" ${ZABBIX_DIR}/scripts/agentd/virbix/virbix.conf

template?

I think you forgot to upload the .xml template file

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.