Ad Widget

Collapse

Zabbix trapper

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix_boy
    Junior Member
    • Jun 2014
    • 4

    #1

    Zabbix trapper

    Hi

    Long time listener - first time caller.

    We currently have some mysql zabbix checks in place that are set up as external scripts.

    The agent reads in the conf files from /etc/zabbix/zabbix_agent.d/

    the mysql.conf is read
    Code:
    UserParameter=mysql.daily,php /etc/zabbix/external_scripts/mysql.php daily user password

    The php file is ran. a DAT file is created in /tmp. Next PHP loops through the DAT file and sends information to to the zabbix trapper. The data is recorded.

    What I have done is tried to duplicate this process since there are some cases where we have more than one mysql instance running on the host.

    On the zabbix server I have copied the items and triggers to a new template.

    I have updated the keys on all of the items. I have triggers in place that read the items and new keys correctly.

    I have the template applied to the host.

    On the client:
    I had updated the mysql.conf to have the new UserParmeters:
    Code:
    UserParameter=mysql_3316.daily,php /etc/zabbix/external_scripts/mysql.php daily user password
    I have updated the PHP script to connect to the socket of the second database instance and have updated the varible SYSTEM from mysql to mysql_3316 (the new key)

    If I run the zabbix_send I can update the trap.
    Code:
     zabbix_sender -vvz 10.0.1.2 -p 10051 -s "server.example.com" -k mysql_3316.Seconds_Behind_Master -o "1"
    If I run the the php file manually I create the DAT file and update all of the items/traps on the server.

    Code:
    php /etc/zabbix/external_scripts/mysql.php daily user password
    I have restarted the zabbix agent on the host.

    My issue though is that the agent isn't executing the UserParameters. I know it is reading the conf file, because I can generate a duplicate key error. I have also tried using a separate conf file for the new user parameters in zabbix_agent.d folder on the host.

    When I view the zabbix-agent.log I can only see the existing trap/user parameter being executed, but never the new one!

    Code:
     15804:20140604:212731.093 Run remote command [php /etc/zabbix/external_scripts/mysql.php live user password] Result [1] [1]...
     15804:20140604:212731.093 Sending back [1]
    What I am I missing here? Do I have to deploy or update something on the zabbix proxy or server?
  • zabbix_boy
    Junior Member
    • Jun 2014
    • 4

    #2
    zabbix_get

    I can run zabbix_get from the proxy and receive updated information in the dashboard.

    Code:
    $ zabbix_get -s ip.of.the.host -p 10050 -k mysql_3316.live
    1

    Comment

    • zabbix_boy
      Junior Member
      • Jun 2014
      • 4

      #3
      To correct this issue I removed the template from the host and then relinked it. I recall having to do this sometime ago for some hosts with the default Linux template as well.

      Comment

      Working...