Ad Widget

Collapse

Help with Actions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tjh44
    Junior Member
    • Jul 2015
    • 6

    #1

    Help with Actions

    Hi,

    Zabbix version 2.0.3
    Host OS Ubuntu 12.04

    I was panning to set up actions to execute remote commands (as part of a project) but I've just seen the notice about remote commands not being available on active zabbix agents.

    Ultimately I want to have zabbix execute ruby scripts (ideally stored on the host machine as I don't have direct access to the zabbix server) based on triggers changing state.

    example command' ruby .../action1.rb

    I'm wondering about a few options:
    - run a non-active agent in parallel and execute remote commands through this. Would this even work?

    - use telnet commands instead, if so can anyone provide some examples of telnet action operation commands?

    - a non action based solution where I use a script to poll a trigger for its given state. I have working code for this but my supervisor wants a solution where zabbix will trigger it once the trigger state changes.

    **Edit for clarification** - I'm interaction with zabbix only via the API as part of the parameters of the project.

    I'm assuming that actions executing files is fairly common practice (?). Can anyone advise about how they go about this when item data is coming from an active zabbix agent?

    Thanks in advance for any responses.
    Last edited by tjh44; 04-08-2015, 15:01. Reason: Clarification
  • jamesNJ
    Senior Member
    • Jun 2015
    • 103

    #2
    I'm using zabbix 2.4.5.

    I don't think there is a notion of running agents in parallel ... you load the zabbix agent on a host and then configure your items as being either active or passive. Passive seems to be the default where server polls the client, however circumstances may dictate (like fire walling or large scale performance) where active items (client updates server) is preferred. In my case I mainly use passive checks, and use active were required. Log file monitoring seems to require active checking, and these run on host with mixed passive and active checks.

    I haven't tried yet but it looks possible to configure a program or script on the client that you could either invoke with system.run[], or by creating a custom item key.

    Comment

    • tjh44
      Junior Member
      • Jul 2015
      • 6

      #3
      Thanks for your reply. Can you say a bit more about how I might trigger that script? How would it know when the trigger on the zabbix server changes state?

      In case it is of interest: you can set up multiple agents in parallel by following the guidance from this thread. It is quite old but it worked for me.

      I see now that the telnet option is out as that is just a subset of remote commands (not sure why I thought it was an option in the first place).

      I'm now trying to switch my items to passive but I'm having trouble. Does any specific server configuration need to be done? i.e. is it possible that the server I am using is configured to only allow active checks? I am not able to access server configuration to find out as I am piggy backing off an already active network. So far I've edited the items and the agent config but I still seem to be missing an interface. Hopefully I will figure it out from tweaking the hostinterface object but any advice would be appreciated.

      Comment

      • jamesNJ
        Senior Member
        • Jun 2015
        • 103

        #4
        There are several ways in the docs to trigger external programs.

        The item type "external check" will run script on zabbix server. The Telnet and SSH checks can initiate a login session from zabbix server to a node to perform some operation. The Zabbix agent item key system.run[] can be used to run a command on zabbix agent machine. The zabbix agent configuration UserParameter can be used to define executables to custom item keys (I haven't tried that yet myself) I found that in the 2.4 docs, chapter 6 on configuration then Items>User parameters.

        Given that, I am not sure why you need to run multiple agents. I see it is supported, but so far I have not seen any need to run multiple agents.

        Maybe there is a possibility that the zabbix agent configuration is set to allow active check to master, but not set up properly to allow passive check from master to agent. In the agent config file look at the parameters for "Server" and "ServerActive". As I said it could be possible that "Server" was not set correctly and the agent is rejecting connection for passive checks.

        With a properly configured zabbix agent, I don't think the change you are doing should be difficult ... it should be as simple as editing the Item you are interested in and changing it from "Zabbix Agent (active)" to "Zabbix Agent"

        I hope this helps

        Comment

        Working...