Ad Widget

Collapse

UserParameter problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steff
    Junior Member
    • Jul 2006
    • 19

    #1

    UserParameter problem

    Hi all,

    I'm experiencing a strange error with UserParameter.

    I've create a python script that makes a sql query to a db. The script has been named query.sh, it has the execution permission enabled for world and it begins with !#/usr/python. If I exec it on shell it works : ./query.sh and returns 0 or 1.

    I've added in the agent conf file :
    UserParameter=system.db_query,/usr/local/bin/query.sh

    and configured the server to read the item system.db_query from the host where I placed the script.

    But the server responds to that item with "Not supported". Either if I specify in the agent conf file

    UserParameter=Yes

    it doesn't work.

    Some suggestions?

    Thanks in advance,
    steff
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Make sure the return value doesn't have any spaces.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • steff
      Junior Member
      • Jul 2006
      • 19

      #3
      Solved , a coworker found the solution!

      Becuase we ported the script from nagios, we were returning the code also as exit code without knowing that values different from 0 have a special meaning in zabbix.
      So we changed all the exit code to 0 and left only the notification on the stdout.

      Hope it may help.
      Last edited by steff; 25-08-2006, 12:40.

      Comment

      Working...