Page MenuHomeVyOS Platform

Native Zabbix Support
Open, WishlistPublicFEATURE REQUEST

Description

We need to implement native support for Zabbix
like configuration via CLI and corresponding templates for Zabbix
so no additional software installation needed

Details

Difficulty level
Hard (possibly days)

Related Objects

Event Timeline

syncer created this task.Aug 7 2016, 12:13 PM
syncer created this object with edit policy "Administrators".
syncer added a comment.EditedAug 7 2016, 2:37 PM

@higebu seems correct.
It will be a good start

syncer edited subscribers, added: VyOS 1.2 Crux, VyOS 2.0.x; removed: VyOS 1.1.x (1.1.8).
dmbaturin moved this task from Need Triage to Wishlist on the VyOS 1.2 Crux board.May 24 2018, 6:21 PM

I've update installation manual of Zabbix agent for VyOS 1.2
It is easier to maintain now because of using of standard Jessie repository.
Only VyOS scripts should be maintained.

Original implementation is running good both on 1.1.8 and 1.2

https://github.com/begetan/vyos-cfg-zabbix-agent

hexes added a subscriber: hexes.Oct 9 2018, 4:33 AM

I made zabbix-agent and zabbix-proxy support in 1.2, could someone watch on it? Is it ok or not?
(I have no github, only local copy, could we discuss it on russian in telegram?)

oliko added a subscriber: oliko.Oct 12 2018, 8:23 PM
syncer changed the subtype of this task from "Task" to "Feature Request".Oct 19 2018, 9:14 AM
kmpm added a subscriber: kmpm.Jan 21 2019, 2:13 PM
pasik added a subscriber: pasik.Mar 12 2019, 6:14 PM

To install the zabbix-agent (for rolling) you need:

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix/zabbix-agent_4.0.17-2%2Bbuster_amd64.deb
dpkg -i zabbix-agent_4.0.17-2%2Bbuster_amd64.deb

The minimal configuration which are needed.
Specify ip address of server (ip zabbix-server) and active server (ip zabbix-server):

root@vyos:/home/sever# cat /etc/zabbix/zabbix_agentd.conf | egrep -v "#|^$"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/*.conf

Minimal commands :

set service zabbix-agent server
set service zabbix-agent server-active

Minimal Xml:

<?xml version="1.0"?>
<!-- Zabbix-agent configuration -->
<interfaceDefinition>
  <node name="service">
    <children>
      <node name="zabbix-agent" owner="${vyos_conf_scripts_dir}/service-zabbix-agent.py">
        <properties>
          <help>Zabbix-agent settings</help>
          <priority>380</priority>
        </properties>
        <children>
          <leafNode name="server">
            <properties>
              <help>x.x.x.x ipv4 address of the zabbix-server</help>
              <valueHelp>
                <format>ipv4</format>
                <description>Address zabbix-server</description>
              </valueHelp>
              <constraint>
                <validator name="ipv4-address"/>
              </constraint>
            </properties>
          </leafNode>
          <leafNode name="server-active">
            <properties>
              <help>x.x.x.x ipv4 address for active-checks</help>
              <valueHelp>
                <format>ipv4</format>
                <description>Address zabbix-server-active</description>
              </valueHelp>
              <constraint>
                <validator name="ipv4-address"/>
              </constraint>
            </properties>
          </leafNode>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>
sever@vyos:~$ sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-02-01 20:31:10 UTC; 13h ago
 Main PID: 2609 (zabbix_agentd)
    Tasks: 6 (limit: 549)
   Memory: 6.6M
   CGroup: /system.slice/zabbix-agent.service
           ├─2609 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─2611 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─2612 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─2613 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─2614 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─2615 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Feb 01 20:31:10 vyos systemd[1]: Starting Zabbix Agent...
Feb 01 20:31:10 vyos systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
Feb 01 20:31:10 vyos systemd[1]: Started Zabbix Agent.

Can someone write a python handler?

syncer assigned this task to Viacheslav.Mar 1 2020, 9:40 PM

@Viacheslav let's discuss
I think we need to implement template for the server (both SNMP based and agent-based)
Need to decide what we expose, but most likely, interfaces, VRRP, VPN metrics, etc
I also add this to collect user feedback

@syncer One thing to consider. If dynamic interfaces are used and there are several thousand of them (ipoe/ppp), this will kill the server, if we try to pull this data.

syncer added a comment.Mar 2 2020, 1:12 PM

good point,
probably need to handle this via excluding such interfaces

Template for zabbix-server on base zabbix-agent checks (without SNMP).
Dynamically creates items and some graphs for:

  • CPU
  • Memory
  • Cpu Cores
  • Interfaces rate bps/pps
  • Interfaces drops/errors
  • State some services (OpenVPN/VRRP)
  • Conntrack entries (used for nat)

https://github.com/sever-sever/vyos-zabbix/blob/master/VyOS-zabbix-agent.xml

Next step - create Template for SNMP checks.
Maybe add information about bgp/state neighbors?

from https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agentd

ListenIP : List of comma delimited IP addresses that the agent should listen on. -> allow multiple ips.
Server/ServerActive: Multiple comma-delimited addresses can be provided to use several independent Zabbix servers in parallel -> allow multiple servers
UserParameter: User-defined parameter to monitor.

Template VyOS for Zabbix 4.x version with SNMPv2 checks.
No need to install any additional programs.

Low level discovery (lld) for interfaces and their aliases.
Memory/CPU Utilization
VRRP state changes
BGP neighbors autodiscovery

Triggers:
high CPU utilization
low RAM memory
VRRP state was changed
BGP neighbor state not established.

https://github.com/sever-sever/vyos-zabbix/blob/master/Template_OS_VyOS_SNMPv2.xml