Ad Widget

Collapse

UserParameter for sqlplus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aljirn
    Junior Member
    • Nov 2006
    • 3

    #1

    UserParameter for sqlplus

    Hi,
    I tried to configure UserParameter for a key to retrieve some data from monitored Oracle database but failed. I noticed in this forum that Nagios script does that so it should be possible some how. For very basic test I created simple shell script ora_test.sh like this:
    #!/bin/ksh
    result=`sqlplus -s zabbix/zabbix@tst10g @/opt/zabbix/check/test.sql`
    echo $result

    and corresponding entry like this:
    UserParameter=ora_test,/opt/zabbix/check/ora_test.sh

    It perfectly works in client site:

    zabbix_agentd -t ora_test
    ora_test [t|ZABBIX]

    But in the server site I got:

    zabbix_get -s <client_machine> -k ora_test
    ZBX_NOTSUPPORTED

    Any help to fix that will be much appreciated.
    Thanks,
  • alj
    Senior Member
    • Aug 2006
    • 188

    #2
    1. with oracle you need to set ORACLE_HOME and all other required system variables otherwise it wont work.
    2. sqlplus should be accessible to zabbix user. Login as zabbix user and test your script.
    3. Make sure script ends with "exit 0"

    Comment

    • aljirn
      Junior Member
      • Nov 2006
      • 3

      #3
      Thank you for fast reply!
      I am DBA actually so I understand clear how Oracle configuration should be. Everything works localy. Shell script does return 0 upon execution. Zabbix OS user is part of DBA group and has $ORACLE_HOME/bin in its PATH. Zabbix Oracle user also has enough permissions. I am wondering if there are any specific issues around of using sqlplus.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Perhaps value type is set to numeric, so ZABBIX is unable to convert string "ZABBIX"...
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • aljirn
          Junior Member
          • Nov 2006
          • 3

          #5
          Hi Alexei,
          Thanks for reply.
          I do setup "Type of information" as "Text" so it shouldn't be a reason.
          By the way, does type matter when you run zabbix_get in server to test?
          I am confusing that zabbix_agentd -t ... works fine but zabbix_get doesn't.

          Another question please. Is it right that remote commands setup in UserParameter are executed by zabbix user in client site?

          I believe that there is permission problem some where.

          Anyways, thanks for product and support.

          Comment

          Working...