2 $auth = Auth
::instance();
4 # translate menu labels
6 $menu_items['section_about'] = _('About');
7 $menu_items['portal'] = _('op5 Portal');
8 $menu_items['manual'] = _('op5 Monitor manual');
9 $menu_items['support'] = _('op5 Support portal');
10 $menu_items['ninja_project'] = _('The Ninja project');
11 $menu_items['merlin_project'] = _('The Merlin project');
12 $menu_items['project_documentation'] = _('Project documentation');
14 $menu_items['section_monitoring'] = _('Monitoring');
15 $menu_items['tac'] = _('Tactical overview');
16 $menu_items['host_detail'] = _('Host detail');
17 $menu_items['service_detail'] = _('Service detail');
19 $menu_items['hostgroup_summary'] = _('Hostgroup summary');
21 $menu_items['servicegroup_summary'] = _('Servicegroup summary');
23 $menu_items['network_outages'] = _('Network outages');
25 $menu_items['comments'] = _('Comments');
26 $menu_items['scheduled_downtime'] = _('Scheduled downtime');
27 $menu_items['recurring_downtime'] = _('Recurring downtime');
28 $menu_items['process_info'] = _('Process info');
29 $menu_items['performance_info'] = _('Performance info');
30 $menu_items['scheduling_queue'] = _('Scheduling queue');
31 /* $menu_items['rotation'] = _('Rotation'); - Disable Rotational view link for now */
33 $menu_items['nagvis'] = _('NagVis');
35 if (Kohana
::config('hypergraph.hyperapplet_path') !== false) {
36 $menu_items['hyper_map'] = _('Hyper Map');
39 $menu_items['section_reporting'] = _('Reporting');
40 $menu_items['pnp'] = _('Graphs');
41 $menu_items['alert_history'] = _('Alert history');
42 $menu_items['alert_summary'] = _('Alert summary');
43 $menu_items['notifications'] = _('Notifications');
44 $menu_items['event_log'] = _('Event log');
45 $menu_items['availability'] = _('Availability');
46 $menu_items['sla'] = _('SLA Reporting');
47 $menu_items['histogram'] = _('Histogram Reporting');
48 $menu_items['schedule_reports'] = _('Schedule reports');
50 if (Kohana
::config('config.cacti_path')) {
51 $menu_items['statistics'] = _('Statistics');
54 if ($auth->authorized_for('configuration_information') && Kohana
::config('config.nacoma_path') !== false) {
55 $menu_items['configure'] = _('Configure');
58 $menu_items['section_configuration'] = _('Configuration');
59 $menu_items['view_config'] = _('View config');
60 $menu_items['my_account'] = _('My Account');
61 $menu_items['backup_restore'] = _('Backup/Restore');
64 * Due to strange javascript behaviour, this can't be translated.
65 * The name is converted to id, which is used to populate the menu items
68 $menu_items['saved_filters'] = 'Saved Filters';
69 $menu_items['loading'] = 'Loading...';
71 # menu structure using array keys from translated labels above
73 'section_about' => array('portal', 'manual', 'support', 'ninja_project', 'merlin_project', 'project_documentation'),
74 'section_monitoring' => array('tac', 'host_detail', 'service_detail',
75 'hostgroup_summary', 'hostgroup_overview', 'hostgroup_grid',
76 'servicegroup_summary', 'servicegroup_overview', 'servicegroup_grid',
77 'network_outages', //'host_problems', 'service_problems', 'unhandled_problems',
78 'comments', 'scheduled_downtime', 'recurring_downtime', 'process_info', 'scheduling_queue', 'performance_info', 'hyper_map', 'nagvis'), /* remove hardcoded nagvis menu entry */
79 'section_reporting' => array('trends', 'pnp', 'alert_history', 'alert_summary', 'notifications', 'event_log',
80 'availability', 'sla', 'histogram', 'schedule_reports', 'statistics'),
81 'section_configuration' => array('view_config', 'my_account', 'backup_restore', 'configure')
84 // Preparing the reporting section on beforehand since it might or might not include the pnp link
85 $section_reporting = array();
86 if(Kohana
::config('config.pnp4nagios_path') !== false) {
87 $section_reporting[$menu_items['pnp']] = array('/pnp?host=.pnp-internal&srv=runtime', 'pnp',0);
89 $section_reporting[$menu_items['alert_history']] = array('/alert_history/generate', 'alerthistory',0);
90 $section_reporting[$menu_items['alert_summary']]= array('/summary', 'alertsummary',0);
91 $section_reporting[$menu_items['notifications']] = array(listview
::querylink('[notifications] all'), 'notifications',1);
92 $section_reporting[$menu_items['event_log']] = array('/showlog/showlog', 'eventlog',0);
93 $section_reporting[$menu_items['availability']] = array('/avail/index', 'availability',0);
94 $section_reporting[$menu_items['sla']] = array('/sla/index', 'sla',0);
95 $section_reporting[$menu_items['histogram']] = array('/histogram/index', 'histogram',0);
96 $section_reporting[$menu_items['schedule_reports']]= array('/schedule/show', 'schedulereports',0);
100 $menu_items['section_about'] => array(
101 $menu_items['portal'] => array('//'.$_SERVER['HTTP_HOST'], 'portal',2),
102 $menu_items['manual'] => array('//'.$_SERVER['HTTP_HOST'].'/monitor/op5/manual/index.html', 'manual',2),
103 $menu_items['support'] => array('http://www.op5.com/support', 'support',2),
104 $menu_items['ninja_project'] => array('http://www.op5.org/community/plugin-inventory/op5-projects/ninja', 'ninja',3),
105 $menu_items['merlin_project'] => array('http://www.op5.org/community/plugin-inventory/op5-projects/merlin', 'merlin',3),
106 $menu_items['project_documentation'] => array('https://kb.op5.com/x/aYAK', 'eventlog',3),
108 $menu_items['section_monitoring'] => array(
109 $menu_items['tac'] => array('/tac', 'tac',0),
110 $menu_items['host_detail'] => array(listview
::querylink('[hosts] all'), 'host',1),
111 $menu_items['service_detail'] => array(listview
::querylink('[services] all'), 'service',1),
112 $menu_items['hostgroup_summary'] => array(listview
::querylink('[hostgroups] all'), 'hostgroupsummary',1),
113 $menu_items['servicegroup_summary'] => array(listview
::querylink('[servicegroups] all'), 'servicegroupsummary',1),
114 $menu_items['network_outages'] => array('/outages', 'outages',0),
115 $menu_items['comments'] => array(listview
::querylink('[comments] all'), 'comments',1),
116 $menu_items['scheduled_downtime'] => array(listview
::querylink('[downtimes] all'), 'scheduledowntime',1),
117 $menu_items['recurring_downtime'] => array(listview
::querylink('[recurring_downtimes] all'), 'recurringdowntime', 1),
119 $menu_items['process_info'] => array('/extinfo/show_process_info', 'processinfo',0),
120 $menu_items['performance_info'] => array('/extinfo/performance', 'performanceinfo',0),
121 $menu_items['scheduling_queue'] => array('/extinfo/scheduling_queue', 'schedulingqueue',0),
122 /* $menu_items['rotation'] => array('/rotation/index', 'nagvis',0) Disable rotational view for now */
124 $menu_items['section_reporting'] => $section_reporting,
125 $menu_items['saved_filters'] => array(
126 $menu_items['loading'] => array('#','test', 0)
128 $menu_items['section_configuration'] => array(
129 $menu_items['view_config'] => array('/config', 'viewconfig',0),
130 $menu_items['my_account'] => array('/user', 'password',0),
131 $menu_items['backup_restore'] => array('/backup', 'backup',0)
135 if (isset($menu_items['hyper_map']))
136 $menu_base[$menu_items['section_monitoring']][$menu_items['hyper_map']] = array('/hypermap', 'hypermap',0);
139 /* remove hardcoded nagvis menu entry */
140 if (isset($menu_items['nagvis']) && Kohana
::config('nagvis.nagvis_path'))
141 $menu_base[$menu_items['section_monitoring']][$menu_items['nagvis']] = array('/nagvis/index', 'nagvis',0);
144 if (Kohana
::config('config.site_domain') != '/monitor/') {
145 # remove op5 monitor specific links
146 unset($menu_base[$menu_items['section_about']][$menu_items['portal']]);
147 unset($menu_items['portal']);
148 unset($menu['section_about']['portal']);
150 unset($menu_base[$menu_items['section_about']][$menu_items['manual']]);
151 unset($menu_items['manual']);
152 unset($menu['section_about']['manual']);
154 unset($menu_base[$menu_items['section_about']][$menu_items['support']]);
155 unset($menu_items['support']);
156 unset($menu['section_about']['support']);
159 # master menu section
167 $xtra_menu = Kohana
::config('menu.items');
168 if (!empty($xtra_menu)) {
169 foreach ($xtra_menu as $section => $page_info) {
170 foreach ($page_info as $page => $info) {
171 # Use key from info array if available
172 # if not - we use the page as key
173 # info array should contain the following fields:
174 # path, icon, link_flag, page_key
175 # where link_flag has value 0-3 and controls link type
176 # (relative/absolute) and visibility (op5/community)
177 $page_key = isset($info[3]) ?
$info[3] : $page;
178 $menu_items[$page] = $page_key;
179 $menu_base[$section][$page_key] = $info;
180 $menu['section_'.strtolower($section)][] = $page;
182 unset($xtra_menu[$section]);
186 # Add NACOMA link only if enabled in config
187 if (isset($menu_items['configure']))
188 $menu_base[$menu_items['section_configuration']][$menu_items['configure']] = array('/configuration/configure','nacoma',0);