Ad Widget

Collapse

Zabbix 1.5.4 - Build 5766 - DM Environment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #16
    Originally posted by Palmertree
    Aly,

    I only tried this for latest data but I was able to retain my users' profile settings between nodes by making the following changes in red. There might be a better way but I thought that this might of interest to someone.

    latest.php
    Code:
    50         [COLOR="Red"]if(!$ZBX_WITH_SUBNODES)
     51                 $profile_nodeid = get_current_nodeid();
     52         else
     53                 $profile_nodeid = 0;[/COLOR]
     54
     55         check_fields($fields);
     56         validate_sort_and_sortorder('i.description',ZBX_SORT_UP);
     57
     58         $options = array('allow_all_hosts','monitored_hosts','with_monitored_items');
     59
     60         $_REQUEST['hostid'] = get_request('hostid',get_profile('web.latest.last.hostid[COLOR="Red"].'.$profile_nodeid[/COLOR]));
     61         if(!isset($_REQUEST['hostid'])){
     62                 array_push($options,'always_select_first_host');
     63
     64                 $_REQUEST['groupid'] = get_request('groupid',get_profile('web.latest.last.groupid.'[COLOR="Red"].$profile_nodeid[/COLOR]));
     65                 if(!isset($_REQUEST['groupid'])){
     66                         validate_group(PERM_READ_ONLY,array('allow_all_hosts','monitored_hosts','with_monitored_items','always_select_first_group'),'web.latest.last.groupid.'[COLOR="Red"].$profile_nodeid[/COLOR]);
     67                 }
     68         }
     69
     70         if(!$ZBX_WITH_SUBNODES) array_push($options,'only_current_node');
     71
     72         validate_group_with_host(PERM_READ_ONLY,$options,'web.latest.last.groupid[COLOR="Red"].'.$profile_nodeid[/COLOR],'web.latest.last.hostid[COLOR="Red"].'.$profile_nodeid[/COLOR]);
     73
     74 ?>
     75 <?php
     76

    Side note: I was getting permission errors when changing "Current Node" from one node to another since the groupid and hostid were not valid. This went away after tracking groupid and hostid for each node in the profile. Just thought that I would share this little bit of info.

    Comment

    Working...