Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-5996

Check now button from dashboard

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • None

      Hello Zabbix Team,

      we need to run 'check now' function from dashboard without to find it over hosts. Is possible to add it to mainstream? We need it mainly at Problems widget.

      I made some workaround and i paste it here how badly i did it. But it's working.

      From dashboard i'm going to URL: https://.../zabbix/check_now.php?itemid=$itemid&form=update&filter_set=1

      Icon with URL i added to: include/classes/screens/CScreenProblem.php

      $hint_table->addRow([
      new CCol($item['name_expanded']),
      new CCol(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $last_value['clock'])),
      new CCol($last_value['value']),
      new CCol(new CLink(new CImg('imgstore.php?iconid=188', 'no image', null, 15, 15), (new CUrl('check_now.php'))
      ->setArgument('itemid', $itemid)
      ->setArgument('form', 'update')
      ->setArgument('filter_set', '1')
      ->getUrl()
      )
      ),
      new CCol(($item['value_type'] == ITEM_VALUE_TYPE_FLOAT || $item['value_type'] == ITEM_VALUE_TYPE_UINT64)
      ? new CLink(_('Graph'), (new CUrl('history.php'))
      ->setArgument('action', HISTORY_GRAPH)
      ->setArgument('itemids[]', $itemid)
      ->getUrl()
      )
      : new CLink(_('History'), (new CUrl('history.php'))
      ->setArgument('action', HISTORY_VALUES)
      ->setArgument('itemids[]', $itemid)
      ->getUrl()
      )
      )
      ]);

      And check_now.php from root dir is edited items.php file:

      $subfiltersList = ['subfilter_apps', 'subfilter_types', 'subfilter_value_types', 'subfilter_status',
      'subfilter_state', 'subfilter_templated_items', 'subfilter_with_triggers', 'subfilter_hosts', 'subfilter_interval',
      'subfilter_history', 'subfilter_trends', 'subfilter_discovery'
      ];

      /*

      • Permissions
        */
        $itemId = getRequest('itemid');
        if ($itemId)
        Unknown macro: { $result = (bool) API}

      require_once dirname(_FILE_).'/include/page_footer.php';

      It's working over second page (check_now.php). It will be better to show only recheck icon near Last value, and if i click it, it will send request from dashboard directly (without going to next page to trigger it).

      Thank you for response.

        1. check_now.php
          16 kB
        2. check_now.tgz
          15 kB
        3. check-now-dashboard.PNG
          check-now-dashboard.PNG
          19 kB
        4. CScreenProblem.php
          40 kB
        5. image-2022-03-23-15-18-01-079.png
          image-2022-03-23-15-18-01-079.png
          10 kB
        6. request-send.PNG
          request-send.PNG
          12 kB

            Unassigned Unassigned
            RomanBelda Roman Belda
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: