CS: Fix violations in MonitoringProperties, NotificationView and StatusQuery
refs #4187
This commit is contained in:
parent
e5f3a063fb
commit
83fb198cd2
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
@ -158,8 +159,8 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$val .= ' / '. $this->floatFormatter(
|
$val .= ' / '. $this->floatFormatter(
|
||||||
isset($object->check_execution_time) ? $object->check_execution_time : 0
|
isset($object->check_execution_time) ? $object->check_execution_time : 0
|
||||||
). ' seconds';
|
). ' seconds';
|
||||||
|
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
@ -274,13 +275,14 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract
|
||||||
return 'N/A';
|
return 'N/A';
|
||||||
}
|
}
|
||||||
$type = self::$notificationReasons[$reason];
|
$type = self::$notificationReasons[$reason];
|
||||||
if ($reason === 8 ) {
|
if ($reason === 8) {
|
||||||
if (intval($notification->notification_type) === 0) {
|
if (intval($notification->notification_type) === 0) {
|
||||||
$type .= '(UP)';
|
$type .= '(UP)';
|
||||||
} else {
|
} else {
|
||||||
$type .= '(OK)';
|
$type .= '(OK)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $type;
|
return $type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// @codingStandardsIgnoreStop
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Monitoring\Backend\Ido\Query;
|
namespace Monitoring\Backend\Ido\Query;
|
||||||
|
|
||||||
|
@ -238,13 +241,13 @@ class StatusQuery extends AbstractQuery
|
||||||
array('ho' => $this->prefix . 'objects'),
|
array('ho' => $this->prefix . 'objects'),
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('hs' => $this->prefix . 'hoststatus'),
|
array('hs' => $this->prefix . 'hoststatus'),
|
||||||
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('h' => $this->prefix . 'hosts'),
|
array('h' => $this->prefix . 'hosts'),
|
||||||
'hs.host_object_id = h.host_object_id',
|
'hs.host_object_id = h.host_object_id',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables = array(
|
$this->joinedVirtualTables = array(
|
||||||
'hosts' => true,
|
'hosts' => true,
|
||||||
|
@ -269,14 +272,14 @@ class StatusQuery extends AbstractQuery
|
||||||
's.host_object_id = h.host_object_id',
|
's.host_object_id = h.host_object_id',
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('so' => $this->prefix . 'objects'),
|
array('so' => $this->prefix . 'objects'),
|
||||||
'so.'.$this->object_id.' = s.service_object_id AND so.is_active = 1',
|
'so.'.$this->object_id.' = s.service_object_id AND so.is_active = 1',
|
||||||
array()
|
array()
|
||||||
)->joinLeft(
|
)->joinLeft(
|
||||||
array('ss' => $this->prefix . 'servicestatus'),
|
array('ss' => $this->prefix . 'servicestatus'),
|
||||||
'so.'.$this->object_id.' = ss.service_object_id',
|
'so.'.$this->object_id.' = ss.service_object_id',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Test this one, doesn't seem to work right now
|
// TODO: Test this one, doesn't seem to work right now
|
||||||
|
@ -296,10 +299,10 @@ class StatusQuery extends AbstractQuery
|
||||||
'hgm.host_object_id = h.host_object_id',
|
'hgm.host_object_id = h.host_object_id',
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('hg' => $this->prefix . 'hostgroups'),
|
array('hg' => $this->prefix . 'hostgroups'),
|
||||||
'hgm.hostgroup_id = hg'.$this->hostgroup_id,
|
'hgm.hostgroup_id = hg'.$this->hostgroup_id,
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -311,15 +314,15 @@ class StatusQuery extends AbstractQuery
|
||||||
'hgm.host_object_id = s.host_object_id',
|
'hgm.host_object_id = s.host_object_id',
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('hg' => $this->prefix . 'hostgroups'),
|
array('hg' => $this->prefix . 'hostgroups'),
|
||||||
'hgm.hostgroup_id = hg.' . $this->hostgroup_id,
|
'hgm.hostgroup_id = hg.' . $this->hostgroup_id,
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('hgo' => $this->prefix . 'objects'),
|
array('hgo' => $this->prefix . 'objects'),
|
||||||
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id'
|
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id'
|
||||||
. ' AND hgo.is_active = 1',
|
. ' AND hgo.is_active = 1',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -332,16 +335,15 @@ class StatusQuery extends AbstractQuery
|
||||||
'sgm.service_object_id = s.service_object_id',
|
'sgm.service_object_id = s.service_object_id',
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
|
array('sg' => $this->prefix . 'servicegroups'),
|
||||||
array('sg' => $this->prefix . 'servicegroups'),
|
'sgm.servicegroup_id = sg.' . $this->servicegroup_id,
|
||||||
'sgm.servicegroup_id = sg.' . $this->servicegroup_id,
|
array()
|
||||||
array()
|
)->join(
|
||||||
)->join(
|
array('sgo' => $this->prefix . 'objects'),
|
||||||
array('sgo' => $this->prefix . 'objects'),
|
'sgo.' . $this->object_id. ' = sg.servicegroup_object_id'
|
||||||
'sgo.' . $this->object_id. ' = sg.servicegroup_object_id'
|
. ' AND sgo.is_active = 1',
|
||||||
. ' AND sgo.is_active = 1',
|
array()
|
||||||
array()
|
);
|
||||||
);
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -385,3 +387,4 @@ class StatusQuery extends AbstractQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// @codingStandardsIgnoreStop
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Monitoring\View;
|
namespace Monitoring\View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,4 +56,4 @@ class NotificationView extends MonitoringView
|
||||||
'default_dir' => self::SORT_DESC
|
'default_dir' => self::SORT_DESC
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue