Ad Widget

Collapse

Passing text data to Zabbix from agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johntest
    Junior Member
    • Mar 2015
    • 14

    #1

    Passing text data to Zabbix from agent

    Hi everyone,

    I am working on a project to create Zabbix monitoring for Openstack.
    I am monitoring based on command output such as "nova service-list" or "neutron agent-list".

    Output of "neutron agent-list" looks like this

    +--------------------------------------+--------------------+-------+-------+----------------+
    | id | agent_type | host | alive | admin_state_up |
    +--------------------------------------+--------------------+-------+-------+----------------+
    | 1b69828d-6a9b-4826-87cd-1757f0e27f31 | Linux bridge agent | HostA | :-) | True |
    | a0c1c21c-d4f4-4577-9ec7-908f2d48622d | DHCP agent | HostA | :-) | True |
    | ed96b856-ae0f-4d75-bb28-40a47ffd7695 | Linux bridge agent | HostB | :-) | True |
    | f28aa126-6edb-4ea5-a81e-8850876bc0a8 | DHCP agent | HostB | :-) | True |
    +--------------------------------------+--------------------+-------+-------+----------------+

    If the agent is not ALIVE, the text changes from ":-)" to "xxx".
    Basically what I need to do is some parsing and send the "agent_type" (name of agent) to Zabbix to be displayed as trigger e.g., "DHCP agent is down".
    Whereas "DHCP agent" is the part we need to get from the table if its not Alive or admin_state is False. So what would be the best way to do this?

    There is a level of complexity added here when multiple agents go down or become disabled then we need to pass multiple values to Zabbix server. I am not even sure how to process and send these and then on server end how to make it where a trigger is created for each one that is down.

    Appreciate the help!
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    POC:

    LLD discovering will return monitored instances (id + some human name).
    LLD will create items for every discovered instance (id will be used in key parameter, human name in name/description of the item). For example items will be: neutron.alive[id], neutron.admin_state_up[id],...

    Zabbix agent can send text value to the zabbix server, but numeric (int) is better, because it save DB space. So some text-int mapping should be in agent logic e.g. ':-)' => 1, 'xxx'=>0

    Output looks perfectly parsable, so IMHO the best option for agent userparameter script is python. If you need ~10x better performance, then C and zabbix module is the best option for you.
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    Working...