-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
############################################################################## | ||
# | ||
# Copyright (C) Zenoss, Inc. 2024, all rights reserved. | ||
# | ||
# This content is made available according to terms specified in | ||
# License.zenoss under the directory where your Zenoss product is installed. | ||
# | ||
############################################################################## | ||
--> | ||
<configure xmlns="http://namespaces.zope.org/zope"> | ||
<include package="Products.Jobber" file="meta.zcml"/> | ||
<job class=".jobs.ReindexWinServices"/> | ||
<job class=".jobs.RemoveWinRMServices"/> | ||
<job class=".jobs.ResetClassTypes"/> | ||
</configure> |
39 changes: 39 additions & 0 deletions
39
ZenPacks/zenoss/Microsoft/Windows/migrate/RemoveSoftwareModelerPluginFromDefaults.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
############################################################################## | ||
# | ||
# Copyright (C) Zenoss, Inc. 2024, all rights reserved. | ||
# | ||
# This content is made available according to terms specified in | ||
# License.zenoss under the directory where your Zenoss product is installed. | ||
# | ||
############################################################################## | ||
|
||
import logging | ||
from Products.ZenModel.ZenPack import ZenPackMigration | ||
from Products.ZenModel.migrate.Migrate import Version | ||
|
||
log = logging.getLogger("zen.migrate") | ||
|
||
|
||
class RemoveSoftwareModelerPluginFromDefaults(ZenPackMigration): | ||
# Main class that contains the migrate() method. | ||
# Note version setting. | ||
version = Version(3, 1, 1) | ||
|
||
def get_objects(self, dmd): | ||
objects = [] | ||
dcObject = dmd.Devices.getOrganizer('/Server/Microsoft/Windows') | ||
objects.append(dcObject) | ||
objects.extend(dcObject.getOverriddenObjects("zCollectorPlugins", showDevices=True)) | ||
for ob in objects: | ||
yield ob | ||
|
||
def migrate(self, pack): | ||
try: | ||
for ob in self.get_objects(pack.dmd): | ||
zCollectorPlugins = getattr(ob, "zCollectorPlugins", []) | ||
if 'zenoss.winrm.Software' in zCollectorPlugins: | ||
zCollectorPlugins.remove('zenoss.winrm.Software') | ||
ob.setZenProperty('zCollectorPlugins', zCollectorPlugins) | ||
log.info("Successfully removed 'zenoss.winrm.Software' modeler plugin from the defaults.") | ||
except Exception as e: | ||
log.warning("Failed to remove 'zenoss.winrm.Software' modeler plugin with a message - {}".format(e)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters