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
<style> h2 { color:blue; font-size:12pt; background-color:powderblue; } </style> | |
<h2> | |
1 -- Other<BR> | |
2 -- Ok<BR> | |
3 -- Degraded<BR> | |
4 -- Failed<BR> | |
</h2> |
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
import argparse | |
import yaml | |
import sys | |
import Globals | |
from Products.ZenUtils.ZenScriptBase import ZenScriptBase | |
# Because of circular dependencies, we must import Dumper first | |
from ZenPacks.zenoss.ZenPackLib.lib.helpers.Dumper import Dumper |
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
import argparse | |
import Globals | |
from transaction import commit | |
from Products.ZenUtils.ZenScriptBase import ZenScriptBase | |
parser = argparse.ArgumentParser(description='Example zendmd script with arguments') | |
parser.add_argument( | |
'-d', | |
'--device', |
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
import os | |
from ZenPacks.zenoss.ZenPackLib import zenpacklib | |
# Break out the yaml files for easy reading/editing | |
dirname = os.path.dirname(__file__) | |
tpldir = os.path.join(dirname, "templates") | |
# These are the main yaml files | |
zenpack_files = ( |
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
serviced service shell -s CC_ZP_patch -i zope | |
serviced snapshot commit CC_ZP_patch |
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
serviced service shell -s CC_ZP_Fix -i zope | |
serviced snapshot commit CC_ZP_Fix |
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
#1. Get a list of the serviced ids you want to edit itno a temp file called "to_rename", one per line. | |
#2. Create a script to do the edit you want with sed e.g. | |
#4. Then edit the services using that script | |
#5. e.g.: for i in cat to_rename; do EDITOR=./movepool serviced service edit $i; done | |
# movepool.sh example | |
#!/bin/bash | |
sed -i -e 's/\"PoolID\": \"Prod_.*\",/\"PoolID\": \"resmgr\",/' "$1" |
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
#1) If a device won't delete normally the first method to try is this: | |
dmd.Devices.Example.Path.devices._delObject('DEVICE', suppress_events=True) | |
commit() | |
dmd.global_catalog.uncatalog_object('/zport/dmd/Devices/Example/Path/devices/DEVICE') | |
dmd.Devices.deviceSearch.uncatalog_object('/zport/dmd/Devices/Example/Path/devices/DEVICE') | |
commit() | |
------------------------ |
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
sync() | |
df = getFacade('devices') | |
df.deleteDevices(uids=[df.getDeviceByIpAddress('1.1.1.1').getPrimaryId()]) | |
commit() |
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
def getCatalogNumbers(): | |
catalogsToCheck = [ | |
('CiscoUCS.ucsSearchCatalog', 'dmd.Devices.CiscoUCS.ucsSearchCatalog'), | |
('CloudStack.HostCatalog', 'dmd.Devices.CloudStack.HostCatalog'), | |
('CloudStack.RouterVMCatalog', 'dmd.Devices.CloudStack.RouterVMCatalog'), | |
('CloudStack.SystemVMCatalog', 'dmd.Devices.CloudStack.SystemVMCatalog'), | |
('CloudStack.VirtualMachineCatalog', 'dmd.Devices.CloudStack.VirtualMachineCatalog'), | |
('Devices.deviceSearch', 'dmd.Devices.deviceSearch'), | |
('Devices.searchRRDTemplates', 'dmd.Devices.searchRRDTemplates'), | |
('Events.eventClassSearch', 'dmd.Events.eventClassSearch'), |