Ad Widget

Collapse

UserParameter item issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dpeterson
    Junior Member
    • Apr 2014
    • 26

    #1

    UserParameter item issue

    Hello all,

    I have created a UserParameter with a custom script that allows me to see table locks in the database. Usually this script returns a value of 0, and if any other value other 0 is returned I need to set up a trigger/action to email myself and my team.

    However, after creating the item in Zabbix and adding the UserParameter in the agent config file I am receiving an error from the Zabbix GUI. The error states "Received value [] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]". For the record, I am getting the same error when I try numeric float. As of right now when I run this script (as expected) I receive a value of "0". Why is Zabbix not able to store/display this info? Is there perhaps something easy I am missing?

    Thanks for the help!
    Last edited by dpeterson; 30-10-2014, 18:47.
  • dpeterson
    Junior Member
    • Apr 2014
    • 26

    #2
    Quick reply... I was able to test out this UserParameter using zabbix_get. I am not seeing any output for this item (I have verified my syntax is correct in the UserParameter section of the zabbix agent config file and I have successfully implemented many other UserParameters). Here is the script as well as the output when testing with zabbix_get:

    Script "tablelocks"
    #!/bin/bash

    #connect to the database
    mysql -u zabbix --socket=/tmp/mysql.sock1 --skip-column-names -p<password> <<EOF

    use testdb;

    select CAST(count(*) AS INT)
    from information_schema.processlist
    where info is not null
    and (state like '%locked%'
    or state like '%waiting%');
    EOF


    Zabbix_get test:

    [zabbix@zabbix bin]$ ./zabbix_get -s testserver -p 10061 -k tablelocks

    [zabbix@zabbix bin]$
    Last edited by dpeterson; 30-10-2014, 18:47.

    Comment

    Working...