Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
f238daef
Commit
f238daef
authored
Oct 03, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Add alarm for identify instances allocated on closed computers
parent
403a1285
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
246 additions
and
0 deletions
+246
-0
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_instance_on_closed_computer.xml
...l_alarms/slapos_crm_check_instance_on_closed_computer.xml
+84
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_searchInstanceOnClosedComputer.py
...os_crm_monitoring/Alarm_searchInstanceOnClosedComputer.py
+18
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_searchInstanceOnClosedComputer.xml
...s_crm_monitoring/Alarm_searchInstanceOnClosedComputer.xml
+62
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_checkInstanceOnCloseAllocation.py
...crm_monitoring/Computer_checkInstanceOnCloseAllocation.py
+20
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_checkInstanceOnCloseAllocation.xml
...rm_monitoring/Computer_checkInstanceOnCloseAllocation.xml
+62
-0
No files found.
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_instance_on_closed_computer.xml
0 → 100644
View file @
f238daef
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_searchInstanceOnClosedComputer
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_crm_check_instance_on_closed_computer
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple>
<int>
1
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple>
<int>
0
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_week_day
</string>
</key>
<value>
<tuple>
<string>
Monday
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Check Instance on closed Computers
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_searchInstanceOnClosedComputer.py
0 → 100644
View file @
f238daef
portal
=
context
.
getPortalObject
()
active_process
=
context
.
newActiveProcess
().
getRelativeUrl
()
# Closed computers like this might contains unremoved instances hanging there.
category_close_forever
=
portal
.
restrictedTraverse
(
"portal_categories/allocation_scope/close/forever"
,
None
)
category_close_outdated
=
portal
.
restrictedTraverse
(
"portal_categories/allocation_scope/close/outdated"
,
None
)
return
portal
.
portal_catalog
.
searchAndActivate
(
method_kw
=
dict
(
fixit
=
fixit
,
active_process
=
active_process
),
method_id
=
"Computer_checkInstanceOnCloseAllocation"
,
portal_type
=
'Computer'
,
default_allocation_scope_uid
=
[
category_close_forever
.
getUid
(),
category_close_outdated
.
getUid
()],
validation_state
=
"validated"
,
activite_kw
=
{
"tag"
:
tag
}
)
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_searchInstanceOnClosedComputer.xml
0 → 100644
View file @
f238daef
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit, tag, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_searchInstanceOnClosedComputer
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_checkInstanceOnCloseAllocation.py
0 → 100644
View file @
f238daef
from
Products.CMFActivity.ActiveResult
import
ActiveResult
portal
=
context
.
getPortalObject
()
active_process
=
portal
.
restrictedTraverse
(
active_process
)
partition_uid_list
=
[
computer_partition
.
getUid
()
for
computer_partition
in
context
.
objectValues
(
portal_type
=
"Computer Partition"
)]
if
not
partition_uid_list
:
return
for
software_instance
in
portal
.
portal_catalog
(
portal_type
=
"Software Instance"
,
default_aggregate_uid
=
partition_uid_list
):
if
software_instance
.
getSlapState
()
==
"destroy_requested"
:
continue
active_process
.
postResult
(
ActiveResult
(
summary
=
"%s"
%
software_instance
.
getRelativeUrl
(),
severity
=
100
,
detail
=
"%s on %s"
%
(
software_instance
.
getRelativeUrl
(),
context
.
getRelativeUrl
())))
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Computer_checkInstanceOnCloseAllocation.xml
0 → 100644
View file @
f238daef
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit, active_process
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Computer_checkInstanceOnCloseAllocation
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment