Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  2. ZBX-4889

gui scripts for disabled hosts do not work


    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.0rc4
    • 2.0.0rc1
    • Server (S)
    • None

      Caused by implementing ZBX-4296

      As we know disabled hosts missing in the server configuration cache.
      So, when gui tries to ask server to execute a script for a host which is disabled in gui, the server immediately responds with "red" ERROR:
      Unknown Host ID [10054]

      Debuglog shows (the hostid=10054 is disabled):
      16049:20120418:203158.324 Trapper got [


      ] len 64
      16049:20120418:203158.324 In node_process_command()
      16049:20120418:203158.324 In execute_script() scriptid:5 hostid:10054
      16049:20120418:203158.324 End of execute_script():FAIL

      For an enabled hostid=10017 Debuglog shows:
      16049:20120418:203232.804 Trapper got [


      ] len 64
      16049:20120418:203232.804 In node_process_command()
      16049:20120418:203232.804 In execute_script() scriptid:5 hostid:10017
      16049:20120418:203232.804 In zbx_execute_script()
      16049:20120418:203232.804 In DBget_script_by_scriptid()
      16049:20120418:203232.804 query [txnlev:0] [select type,execute_on,command,groupid from scripts where scriptid=5]
      16049:20120418:203232.804 End of DBget_script_by_scriptid():SUCCEED
      16049:20120418:203232.804 In check_script_permissions() groupid:0 hostid:10017
      16049:20120418:203232.804 End of check_script_permissions():SUCCEED
      16049:20120418:203232.804 In substitute_simple_macros() data:'/usr/bin/fping -c2 -p20


      16049:20120418:203232.804 End substitute_simple_macros() data:'/usr/bin/fping -c2 -p20 2>&1'
      16049:20120418:203232.804 In zbx_execute_script()
      16049:20120418:203232.804 In zbx_popen() command:'/usr/bin/fping -c2 -p20 2>&1'
      16049:20120418:203232.804 End of zbx_popen():9
      16049:20120418:203232.847 In zbx_waitpid()
      16049:20120418:203232.847 zbx_waitpid() exited, status:0
      16049:20120418:203232.847 End of zbx_waitpid():16100
      16049:20120418:203232.847 End of zbx_execute_script():SUCCEED
      16049:20120418:203232.847 End of zbx_execute_script():SUCCEED
      16049:20120418:203232.847 End of execute_script():SUCCEED

      I see two possible solutions:
      1. discard changes in ZBX-4296 (bad)
      2. allow server to not use configuration cache when executing gui scripts (good one)

      But main question - how the ZBX-4296 has been tested before closing?

            Unassigned Unassigned
            zalex_ua Oleksii Zagorskyi
            0 Vote for this issue
            3 Start watching this issue