[ZBX-8671] CONFIGURATION OF WEB MONITORING page filter display all hosts if selected wrong host Created: 2014 Aug 27  Updated: 2017 May 30  Resolved: 2015 Feb 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.3.4
Fix Version/s: 2.5.0

Type: Incident report Priority: Trivial
Reporter: Oleg Egorov (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: filter, webmonitoring
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

frontends/php/httpconf.php?sid=a59dd4d563cc0ea1&form_refresh=13&groupid=0&hostid=9999999999999

hostid=9999999999999 not exist, but filter displayed as host:all

In other pages, in the same situation, for example, in Monitoring->Triggers
ERROR: No permissions to referred object or it does not exist!



 Comments   
Comment by Krists Krigers (Inactive) [ 2014 Aug 29 ]

Fixed in r48587 and r48593, branch svn://svn.zabbix.com/branches/dev/ZBX-8671.

Comment by Ivo Kurzemnieks [ 2014 Sep 01 ]

(1) String changes?

kristsk No string changes. RESOLVED.

iivs Added strings:
'No trigger prototypes found.'

kristsk CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Sep 01 ]

(2) now &hostid=0 got broken

kristsk RESOLVED in r48670.

iivs CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Sep 01 ]

(3) Other similar places were ignored.

  • Places that need fixing for "groupid":
    • Configuration > Triggers > group selection
    • Configuration > Graphs > group selection
  • Places where host selection redundant:
    • Configuration > Item prototypes > host selection
    • Configuration > Trigger prototypes > host selection
    • Configuration > Graph prototypes > host selection
  • Places where "filter_hostid" and "filter_groupid" is not validated:
    • Configuration > Item list > Filter > group selection
    • Configuration > Item list > Filter > host selection

Please see if there any other incosintencies, missing validation or redundant parameters regarding "hostid" and "groupid" in URL.

kristsk RESOLVED in r48670.

iivs

  1. In configuration pages, permissions should be checked for writing, not simple API get requests.
  2. code pieces like
     $discoveryRuleId = getRequest('parent_discoveryid', false);
    if (!$discoveryRuleId) {
    	access_deny();
    } 

    will not execute due to check_fields O_MAND option.

  3. do not access directly $_REQUEST and set values to it
  4. avoid using API_OUTPUT_EXTEND
  5. if you do not need field in return, but simply check if execution was success, you can use empty array() for output and don't forget to put output as first option as well.
  6. change the order so that first group permissions are checked and then host permissions.

REOPENED.

kristsk RESOLVED in r48861.

iivs There were still many more issues with this.
What I did:

  • Changed several API calls to return only boolean values to check permissions since no fields are requested in output.
  • item prototype edit form:
    • changed item prototype permission check from itemprototype.get to itemprototype.iswritable
  • graphs:
    • moved group permission to be validated first and then other parameters;
    • added missing parameter for getting graph discovery rule.
  • separated display logic for trigger prototype list.
  • fixes several coding style issues.

Please, review r48968

kristsk Looks good. Did some minor adjustments in r49090. Please review.

iivs REVIEWED.
Thanks!
CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Sep 18 ]

TESTED

Comment by Krists Krigers (Inactive) [ 2014 Sep 19 ]

Fixed and merged to 2.5.0 (trunk) in r49160.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Sep 22 ]

(4) It's now impossible to create a trigger when a host is selected.

kristsk RESOLVED in r49207.

iivs CLOSED.

Comment by richlv [ 2014 Sep 23 ]

subissues stil open: 1, 4

iivs According to history, issue was closed after sub-issues were reviewed and closed and there was no reason to re-open the issue again.

Comment by Ivo Kurzemnieks [ 2014 Sep 23 ]

TESTED

Comment by Krists Krigers (Inactive) [ 2014 Sep 23 ]

Merged to 2.5.0 (trunk) in r49221.

Comment by Alexander Vladishev [ 2014 Dec 03 ]

(5) Host/Template information is not shown in the trigger prototype form

Configuration -> Hosts -> Discovery -> Trigger prototypes -> [Create trigger prototype]

iivs Same problem found in graph prototype create form.
RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-8671 r51934

sasha unsafe code in graphs.php:

if (CUser::$userData['type'] !== USER_TYPE_SUPER_ADMIN) {

because CUser::$userData['type'] has string type and USER_TYPE_SUPER_ADMIN has integer type. It is always true!

REOPENED

iivs RESOLVED in r52081

sasha Possible SQL error:

    pg_query(): Query failed: ERROR: invalid input syntax for integer: "" LINE 1: SELECT h.status FROM hosts h WHERE h.hostid='' ^ [graphs.php:602 → isTemplate() → DBselect() → pg_query() in include/db.inc.php:395]
    Error in query [SELECT h.status FROM hosts h WHERE h.hostid=''] [ERROR: invalid input syntax for integer: "" LINE 1: SELECT h.status FROM hosts h WHERE h.hostid='' ^]

REOPENED

iivs RESOLVED in r52156

Note that there is still a problem when "Dropdown first entry" is set to "none". As discussed, I made a separate issue for it ZBX-9298

sasha CLOSED

Comment by Ivo Kurzemnieks [ 2015 Feb 16 ]

Fixed in pre-2.5.0 (trunk) r52226

Generated at Fri Apr 19 10:13:08 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.