Skip to content

Instantly share code, notes, and snippets.

View dougsyer's full-sized avatar

Doug Syer dougsyer

View GitHub Profile
@dougsyer
dougsyer / component-add-menu.js
Created March 20, 2019 21:36 — forked from cluther/component-add-menu.js
Zenoss: Add item to component-add-menu
(function(){
var router = Zenoss.remote.CustomRouter;
Ext.define('Zenoss.component.add.CustomThing',{
extend: 'Zenoss.SmartFormDialog',
constructor: function(config) {
config = config || {};
Ext.applyIf(config, {
height: 150,
@dougsyer
dougsyer / zenoss-shell-functions
Created July 20, 2017 20:58 — forked from cluther/zenoss-shell-functions
Zenoss JSON API Examples (curl)
# This shell script is intended to be sourced into your shell. It adds
# Default Zenoss server settings.
[ -z "$ZENOSS_URL" ] && export ZENOSS_URL="http://localhost:8080"
[ -z "$ZENOSS_USERNAME" ] && export ZENOSS_USERNAME="admin"
[ -z "$ZENOSS_PASSWORD" ] && export ZENOSS_PASSWORD="zenoss"
# Generic call to make Zenoss JSON API calls easier on the shell.
zenoss_api () {
ROUTER_ENDPOINT=$1
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2012, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
'''
oldPlugin="zenoss.snmp.RouteMap"
newPlugin="IpRouteCSOB"
def replacePlugin(objs):
for obj in objs:
if not obj.hasProperty('zCollectorPlugins'): continue
if oldPlugin not in obj.zCollectorPlugins: continue
print "Replacing plugin for %s." % obj.id
obj.zCollectorPlugins = [
p for p in obj.zCollectorPlugins if p != oldPlugin ]
# This script looks for, and fixes problems where zDeviceTemplates was
# set as a regular object attribute instead of through the acquisition
# mechanism.
from Acquisition import aq_base
for d in dmd.Devices.getSubDevices():
if hasattr(aq_base(d), 'zCollectorPlugins') and not d.hasProperty('zCollectorPlugins'):
print "%s has the problem." % d.id
templates = d.zCollectorPlugins
del(d.zCollectorPlugins)
d._setProperty('zCollectorPlugins', templates)
@dougsyer
dougsyer / addMultiGraphReport.py
Created October 31, 2012 11:03 — forked from cluther/addMultiGraphReport.py
Programatically Build a Multi-Graph Report
#!/usr/bin/env python
import sys
import Globals
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
# Check command line options.
if len(sys.argv) < 2:
print >> sys.stderr, "Usage: %s <device>" % sys.argv[0]
sys.exit(1)