1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 /* @var $set ObjectSet_Model */
4 $it = $set->it(false, array(), 1, 0);
5 /* @var $object Object_Model */
6 $object = $it->current();
8 if( $object instanceof Host_Model
) {
12 } else if( $object instanceof Service_Model
) {
13 $host = $object->get_host();
17 /* @var $host Host_Model */
18 /* @var $service Service_Model */
20 /* @var $object Service_Model */
24 <div
class="right width-33" id
="extinfo_info">
28 <th colspan
="2"><?php
echo ($type == 'host' ?
_('Host Commands') : _('Service Commands')) ?
></th
>
30 <?php
# only for hosts!
32 if ($type == 'host' && Kohana
::config('nagvis.nagvis_real_path', false, false)) {
35 <td
class="icon dark">
36 <span
class="icon-16 x16-locate-host-on-map" title
="<?php echo _('Locate host on map') ?>"></span
>
38 <td
class="bt"><?php
echo html
::anchor('nagvis/automap/host/'.$host->get_name(), _('Locate host on map')) ?
></td
>
44 $label = _("Submit a $type comment");
45 $cmd = $type == 'host' ? nagioscmd
::command_id('ADD_HOST_COMMENT') : nagioscmd
::command_id('ADD_SVC_COMMENT');
47 <td
class="icon dark">
48 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
51 <?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
>
56 if ($object->get_active_checks_enabled()) {
58 $label = _("Disable active checks of this $type");
59 $cmd = $type == 'host' ? nagioscmd
::command_id('DISABLE_HOST_CHECK') : nagioscmd
::command_id('DISABLE_SVC_CHECK');
62 $label = _("Enable active checks of this $type");
63 $cmd = $type == 'host' ? nagioscmd
::command_id('ENABLE_HOST_CHECK') : nagioscmd
::command_id('ENABLE_SVC_CHECK');
65 <td
class="icon dark">
66 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
69 <?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
>
74 $label = _("Re-schedule next $type check");
75 $cmd = $type == 'host' ? nagioscmd
::command_id('SCHEDULE_HOST_CHECK') : nagioscmd
::command_id('SCHEDULE_SVC_CHECK'); ?
>
76 <td
class="icon dark">
77 <?php
echo html
::image($this->add_path('icons/16x16/re-schedule.png'), array('alt' => $label, 'title' => $label)); ?
>
79 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
82 if ($object->get_accept_passive_checks()) {
83 $label = _("Submit passive check result for this $type");
84 $cmd = $type == 'host' ? nagioscmd
::command_id('PROCESS_HOST_CHECK_RESULT') : nagioscmd
::command_id('PROCESS_SERVICE_CHECK_RESULT') ?
>
86 <td
class="icon dark">
87 <span
class="icon-16 x16-checks-passive" title
="<?php echo $label ?>"></span
>
89 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
94 if ($object->get_accept_passive_checks()) {
96 $label = _("Stop accepting passive checks for this $type");
97 $cmd = $type == 'host' ? nagioscmd
::command_id('DISABLE_PASSIVE_HOST_CHECKS') : nagioscmd
::command_id('DISABLE_PASSIVE_SVC_CHECKS');
100 $label= _("Start accepting passive checks for this $type");
101 $cmd = $type == 'host' ? nagioscmd
::command_id('ENABLE_PASSIVE_HOST_CHECKS') : nagioscmd
::command_id('ENABLE_PASSIVE_SVC_CHECKS');
103 <td
class="icon dark">
104 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
106 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
110 if ($object->get_obsess()) {
112 $label = _("Stop obsessing over this $type");
113 $cmd = $type == 'host' ? nagioscmd
::command_id('STOP_OBSESSING_OVER_HOST') : nagioscmd
::command_id('STOP_OBSESSING_OVER_SVC');
116 $label = _('Start obsessing over this host');
117 $cmd = $type == 'host' ? nagioscmd
::command_id('START_OBSESSING_OVER_HOST') : nagioscmd
::command_id('START_OBSESSING_OVER_SVC');
119 <td
class="icon dark">
120 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
122 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
124 <?php
if ($object->get_state()) {
125 if ($object->get_acknowledged()) {
127 $label = _('Remove problem acknowledgement');
128 $cmd = $type == 'host' ? nagioscmd
::command_id('REMOVE_HOST_ACKNOWLEDGEMENT') : nagioscmd
::command_id('REMOVE_SVC_ACKNOWLEDGEMENT');
130 $img = 'acknowledged';
131 $label = _("Acknowledge this $type problem");
132 $cmd = $type == 'host' ? nagioscmd
::command_id('ACKNOWLEDGE_HOST_PROBLEM') : nagioscmd
::command_id('ACKNOWLEDGE_SVC_PROBLEM');
135 <td
class="icon dark">
136 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
138 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
143 $img = 'notify-disabled';
144 if ($object->get_notifications_enabled()) {
145 $label = _("Disable notifications for this $type");
146 $cmd = $type == 'host' ? nagioscmd
::command_id('DISABLE_HOST_NOTIFICATIONS') : nagioscmd
::command_id('DISABLE_SVC_NOTIFICATIONS');
148 $label = _("Enable notifications for this $type");
149 $cmd = $type == 'host' ? nagioscmd
::command_id('ENABLE_HOST_NOTIFICATIONS') : nagioscmd
::command_id('ENABLE_SVC_NOTIFICATIONS');
151 <td
class="icon dark">
152 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
154 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
158 $label = _('Send custom notification');
159 $cmd = $type == 'host' ? nagioscmd
::command_id('SEND_CUSTOM_HOST_NOTIFICATION') : nagioscmd
::command_id('SEND_CUSTOM_SVC_NOTIFICATION');
161 <td
class="icon dark">
162 <span
class="icon-16 x16-notify-send" title
="<?php echo $label ?>"></span
>
164 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
166 <?php
if ($object->get_state() && $object->get_notifications_enabled()) {
167 $label = _("Delay next $type notification");
168 $cmd = $type == 'host' ? nagioscmd
::command_id('DELAY_HOST_NOTIFICATION') : nagioscmd
::command_id('DELAY_SVC_NOTIFICATION');
171 <td
class="icon dark">
172 <span
class="icon-16 x16-notify-delay" title
="<?php echo $label ?>"></span
>
174 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
179 $label = _("Schedule downtime for this $type");
180 $cmd = $type == 'host' ? nagioscmd
::command_id('SCHEDULE_HOST_DOWNTIME') : nagioscmd
::command_id('SCHEDULE_SVC_DOWNTIME');
182 <td
class="icon dark">
183 <span
class="icon-16 x16-scheduled-downtime" title
="<?php echo $label ?>"></span
>
185 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
187 <?php
if ($type == 'host') {?
>
190 $label = _('Disable notifications for all services on this host');
191 $cmd = nagioscmd
::command_id('DISABLE_HOST_SVC_NOTIFICATIONS');
193 <td
class="icon dark">
194 <span
class="icon-16 x16-notify-disabled" title
="<?php echo $label ?>"></span
>
196 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
200 $label = _('Enable notifications for all services on this host');
201 $cmd = nagioscmd
::command_id('ENABLE_HOST_SVC_NOTIFICATIONS');
203 <td
class="icon dark">
204 <span
class="icon-16 x16-notify" title
="<?php echo $label ?>"></span
>
206 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
210 $label = _('Schedule a check of all services on this host');
211 $cmd = nagioscmd
::command_id('SCHEDULE_HOST_SVC_CHECKS');
213 <td
class="icon dark">
214 <span
class="icon-16 x16-schedule" title
="<?php echo $label ?>"></span
>
216 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
220 $label = _('Disable checks of all services on this host');
221 $cmd = nagioscmd
::command_id('DISABLE_HOST_SVC_CHECKS');
223 <td
class="icon dark">
224 <span
class="icon-16 x16-disabled" title
="<?php echo $label ?>"></span
>
226 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
230 $label = _('Enable checks of all services on this host');
231 $cmd = nagioscmd
::command_id('ENABLE_HOST_SVC_CHECKS');
233 <td
class="icon dark">
234 <span
class="icon-16 x16-enabled" title
="<?php echo $label ?>"></span
>
236 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
241 if ($object->get_event_handler_enabled()) {
243 $label = _("Disable event handler for this $type");
244 $cmd = $type == 'host' ? nagioscmd
::command_id('DISABLE_HOST_EVENT_HANDLER') : nagioscmd
::command_id('DISABLE_SVC_EVENT_HANDLER');
247 $label = _("Enable event handler for this $type");
248 $cmd = $type == 'host' ? nagioscmd
::command_id('ENABLE_HOST_EVENT_HANDLER') : nagioscmd
::command_id('ENABLE_SVC_EVENT_HANDLER');
251 <td
class="icon dark">
252 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
254 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
258 if ($object->get_flap_detection_enabled()) {
260 $label = _("Disable flap detection for this $type");
261 $cmd = $type == 'host' ? nagioscmd
::command_id('DISABLE_HOST_FLAP_DETECTION') : nagioscmd
::command_id('DISABLE_SVC_FLAP_DETECTION');
264 $label = _("Enable flap detection for this $type");
265 $cmd = $type == 'host' ? nagioscmd
::command_id('ENABLE_HOST_FLAP_DETECTION') : nagioscmd
::command_id('ENABLE_SVC_FLAP_DETECTION');
268 <td
class="icon dark">
269 <span
class="icon-16 x16-<?php echo $img ?>" title
="<?php echo $label ?>"></span
>
271 <td
><?php
echo nagioscmd
::command_link($cmd, $host->get_name(), $service === false ?
false : $service->get_description(), $label); ?
></td
>
273 <?php
foreach ($object->get_custom_commands() as $command_name => $action) {
274 $linktext = ucwords(strtolower(str_replace('_', ' ', $command_name)));
275 $title = "$command_name;$type";
276 $title .= ';' . $host->get_name();
277 if( $service !== false ) {
278 $title .= ';' . $service->get_description();
280 $link = "<a href='#' title='" . $title . "'>" . $linktext . "</a>";
283 <td
class="icon dark">
284 <span
class="icon-16 x16-cli" title
="<?php echo _("$command_name") ?>"></span
>
286 <td
class="custom_command"><?php
echo $link ?
></td
>