Newest Downloads

Mar.08

  [zenoss@zenoss2 ~]$ python Zenoss_Template_Manager.py -husage: Examples: python Zenoss_Templa...

Feb.01

python queryns.py -husage: queryns.py [options] arg --username=username --password=password --net...

Monitoring
HowTo add Multiple DataPoints to Zenoss using the Zenoss API
Monitoring - Zenoss
Written by Allen Sanabria   
Thursday, 04 March 2010 23:12

I've seen a few people in the Zenoss community forums asking for an easier way to add multiple Datapoints into Zenoss, instead of adding 1 by 1. Well, I've decided to try and build such a tool today. Now even though the tool is not complete (IN MY EYES). It is already has been helpful to me! As of right now the script can List Templates in a Organizer ( aka /Devices/Server/Linux ) or in a Device ( zenoss1.linuxdynasty ).

It can also create a Template, with a Command DataSource, with Multiple DataPoints. This means you can now automate the creation of Templates and DataSources and DataPoints. So if you are using a tool like Puppet, Cfengine, Bcfg2, or Chef, this process can be automated. I will be adding more features in the next few weeks.

Any question or help about this script, please post them here http://www.linuxdynasty.org/forums/Scripting/scripting/ZenossTemplateManager
UPDATES!!!!!!

  • Update 1.0.5, Now have the ability to add multiple graphs with multiple datapoints
  • Update 1.0.4, Now have the ability to create thresholds, bind templates to class or device, set severities on thresholds and
    datasources, attach datapoints to thresholds.
  • Update 1.0.3, I broke down the templateManager function into 3 smaller functions. You also can now list templates and datasources for either device or organizer, and list datapoints for a device. I also added more verbosity with the -V option.
  • Update 1.0.2, You now do not have to pass a command with the script. So i f you already have a command in the DataSource, it wll not get overwritten.. Thank you Eangel, for telling me about this issue..

Upcoming Features such as....

  • Deleteing Templates, DataSources, and DataPoints
  • Copying Templates
  • Adding Graphs

The tool is called Zenoss_Template_Manager.py. You can download it here..

 Download Zenoss_Template_Manager
File Title:Zenoss_Template_Manager (Details)
File Type:py
File Version:1.0.5
File Size:15.23 Kb
License:
File Author:Allen Sanabria
File HomePage:
Downloads:18
Rating: ( Votes)
Your Vote:



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Free Joomla PHP extensions, software, information and tutorials.
Last Updated on Monday, 08 March 2010 16:51
Read more...
 
Syncing up Zenoss with the Citrix Netscaler using Python
Monitoring - Zenoss
Written by Allen Sanabria   
Tuesday, 17 June 2008 14:48

The script below I created to sync up Zenoss with the Citrix Netscalers. What this will do essentially is make sure that all of our devices in Zenoss are in the correct Systems in Zenoss. So for instance lets say we have a cluster called Foo-Cluster and we have 100 devices that are in that cluster as per the netscaler. This script will move those 100 devices into that System aka {Cluster} in Zenoss.

The reason this is so important is that when you update the Citrix Netscaler you will also have to update Zenoss, but if you run this script in cron then you will not have to update Zenoss at all. This script was written in Python This script was tested with Zenoss 2.0.2, Also some modifications may have to be made to fit your environment.

Please post any questions to this script here http://linuxdynasty.org/phpBB3/viewtopic.php?f=5&t=3
You can download the script here  ... zenoss_netscaler_snmp.py



 



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Free Joomla PHP extensions, software, information and tutorials.
Last Updated on Tuesday, 07 April 2009 18:07
Read more...
 
Discovered Zenoss Devices
Monitoring - Zenoss
Written by Allen Sanabria   
Friday, 25 April 2008 23:25

For those Zenoss users out there, this script will send a emailof devices that are in the discovered class.

So once you receive this email you will know that you need to move those devices into there appropriate classes.


#!/bin/env python
#Copyright (C) 2008 Allen Sanabria

#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License along
#with this program; if not, write to the Free Software Foundation, Inc.,
#51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

##############################################################
#Created by Allen Sanabria aka LinuxDynasty aka PrNino69
#This script is to check how many devices are in the
#Discovered Class
#Started Nov 28th
#Completed, Nov 28th
##############################################################

import os, sys
from re import sub
from string import split
from string import join
from urllib import urlopen
from smtplib import SMTP
from time import sleep


user = "zenoss"
passwd = 'zenoss'
util = '@zenoss'
base = "http://%s:%s%s:8080" % (user,passwd,util)
discovered_url = urlopen(base+'/zport/dmd/Devices/Discovered/getSubDevices').read()
discovered_sub = sub("<Device at /zport/dmd/Devices/Discovered/devices/|>|^\[|\]$|,", "", discovered_url)
discovered_list = list(split(discovered_sub))


message = """\nThe boxes below were discovered in the last run of zendisc.\nThey are all located under /Devices/Discovered Class.\n
Please move Devices to appropriate Device class, if one does not exist please create one.\n
This script runs on the zenoss (cc17-22) server."""
devices = sub(",|\[|\]", "\n", str(discovered_list))
BODY = join((message, devices),"\n")
print BODY
FROM = "zenoss@linuxdynasty.org"
TO = "sa@linuxdynasty.org"
SUBJECT = "Devices That Were Discovered During The Network Scan!"
body = join(("From: %s" % FROM, "To: %s" % TO, "Subject: %s" % SUBJECT, "", BODY), "\n")
server = SMTP('localhost')
server.set_debuglevel(1)
server.sendmail(FROM, [TO], body)
sleep(10)
server.quit()


Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Free Joomla PHP extensions, software, information and tutorials.
Last Updated on Tuesday, 29 July 2008 12:26