1

Setup: Zabbix 2.4 | RHEL 6.4

I'm configuring a method to allow Zabbix Agentd services to automatically update their own binaries when a trigger is thrown (using Git as the vessel). Two triggers are in place:

  1. Trigger 1: "Git repo doesn't exist" - Make sure there is a git repository in place where the Zabbix Agentd's binaries are stored.
    a. {Template App Zabbix Agent:vfs.file.exists[/opt/zabbix/.git/config].last()}=0
  2. Trigger 2: "Zabbix Agent version is incorrect." - Trigger if the agent isn't the expected, compiled version. This is set as a user macro.
    a. {Template App Zabbix Agent:vfs.file.cksum[/opt/zabbix/sbin/zabbix_agentd].last()}<>{$LATESTAGENT}
    b. $LATESTAGENT is the cksum() value of the compiled zabbix_agentd binary.
    c. Dependent on Trigger 1

Trigger 1 just ensures if Trigger 2 fires, the agent will be able to run a remote command to perform a git pull and fetch the latest binaries.


Current Situation

The triggers run fine and show my systems where the agent versions don't align. Since then, I've configured a couple actions to go with them to do the dirty work.

  1. Trigger 1 > Run git init in the Zabbix Agentd install path.
  2. Trigger 2 > Run git pull origin master to get the latest bins.

These are just Global Scripts I've created, so I've been able to manually test that they work by clicking any host and selecting the appropriate script for the host.


The Problem

Since I created the triggers first, they are already "triggered;" however, now that I have actions to go with those triggers, I'd like those triggers to "re-trigger" (or reinitialize or re-fire or whatever) to allow the actions to do their thing. Unfortunately, I can't really find a way to do this. Focusing on Trigger 1 (git repo exists), I tried clearing the history on that vfs.file.cksum[/opt/zabbix/sbin/zabbix_agentd] key, but that didn't affect the trigger's state. I've seen some folks mention some SQL or API work to manually modify the trigger state, but it feels like there should be something so much simpler than that!


Summary

  • Created triggers to deploy updated Zabbix Agentd binaries.
  • Created actions to go with triggers.
  • Can't get actions to run on triggers which are already "True"

Anyone have any idea of how I could get my triggers to "trigger again" in order to let the actions do their thing? Thanks for any help on this!

Caveats

  • System CM tools (e.g. Puppet) aren't an option. I need to do this within Zabbix and Git.
  • Cron solutions are out. Tons of servers are in play, so managing those cron jobs and changes (again, no sysCM tool) would be a manual nightmare.
4
  • This isn't very clean. I'd use a proper configuration management system (puppet, chef, salt, whatever) both for keeping the Zabbix agent up to date, and for pulling your git repo. Apr 9, 2015 at 20:01
  • @MichaelHampton Thanks for the feedback. In a beautiful world, I would do just that; however, I've somehow only earned the title of "Zabbix Manager" without the authority of a true sys admin, so I need to develop a solution which works regardless of what the SA's are doing to deploy/manage system configurations. With that said, I'll update the question to clarify that true system configuration tools as you listed are not an option.
    – BrM13
    Apr 9, 2015 at 20:03
  • Did anyone ever tell you that you work in hell? :) Apr 9, 2015 at 20:04
  • I like to think of it as an opportunity to challenge myself to grow and mature. (pronounced "mah-toor")
    – BrM13
    Apr 9, 2015 at 20:22

1 Answer 1

2

As a workaround, you can temporarily change the trigger to "Multiple PROBLEM events generation", wait until all actions you need are executed, and then switch back.

1
  • This was exactly what I wanted. The "Multiple PROBLEM" functionality allowed the actions to be fired by triggers already resolving as "True" because the triggers now create a new event each time the trigger evaluates "True." This allowed me to automate an action on a trigger which is already active/evaluated.
    – BrM13
    Apr 10, 2015 at 12:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .