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 / gist:218bb6dbabc39142da699950d6aa3ceb
Created November 2, 2018 17:00
build command to run zenpacklib -l in sublime
{
"cmd": ["plink", "-ssh", "dev@IP", "-pw", "PW", "zenpacklib", "-l", "${file/(?:^([A-Z]):)|(\\\\)/(?1:\\/\\l$1)(?2:\\/)/g}"],
"selector": "source.yaml",
}
@dougsyer
dougsyer / gist:264cd27eddecda3de1b011cf34b3ad2d
Created July 10, 2018 13:34
creating a graph legend in zenoss 6 description field with html example
<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>
@dougsyer
dougsyer / gist:a5dc4cbadabc550b3db95cd80ef08267
Created October 25, 2017 16:35
Auto adding traps in zenoss from mib imported into zneoss
from Products.ZenEvents.EventClassInst import manage_addEventClassInst
from Products.ZenUtils.Utils import prepId
# get mib organizer
MIBS = dmd.Mibs
org = MIBS.CISCO.SB # CHANGEME: this is the container your mib is in
mib = getattr(org.mibs, 'CISCOSB-TRAPS-MIB') # CHANGEME: this points to the MIB
"""
properties on notications are:
@dougsyer
dougsyer / zenpop3.py
Last active September 21, 2017 18:39
Working on slight modifications to zenpop3
__doc__ = """zenpop3
Turn email messages obtained from POP3 accounts into events.
"""
import logging
import socket
import Globals
@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
@dougsyer
dougsyer / Better linux os command map
Created May 21, 2015 22:13
Better linux os cmd modeller
ZenPacks/NWN/Events/modeler/plugins/NWN/cmd/centos_os_map.py
__version__ = '0.1'
from Products.DataCollector.plugins.CollectorPlugin import CommandPlugin
from Products.DataCollector.plugins.DataMaps import MultiArgs
import re
class centos_os_map(CommandPlugin):
"""
@dougsyer
dougsyer / gist:4b21043e4e0143a20534
Last active October 25, 2017 16:39
parsing zenoss trap snmp trap ciscoEnvMonTempStatusChangeNotif
# your modeller needs to strip off the "GREEN", yellow etc. or you can just change this to walk through the components
# and check to find the right now.
# i have updated envmonE to fix these but i need to publish the update to the public repo..
if device:
from Products.ZenUtils.Utils import prepId
import re
state_map = {
0: ('unknown', 3),
from datetime import datetime
import time
#-------------------------------------------------
# conversions to strings
#-------------------------------------------------
# datetime object to string
dt_obj = datetime(2008, 11, 10, 17, 53, 59)
date_str = dt_obj.strftime("%Y-%m-%d %H:%M:%S")
print date_str
##############################################################################
#
# 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.
#
##############################################################################
'''