Feb 122010
 

Recently I had to prepare for a Zenoss upgrade. During my prep work I had to create a zenpack of all of our Templates. For those of you who use Zenoss, you know how many templates you can start to accumulate in a short amount of time. You can have Templates attached to single Devices, to SubClasses, and to Classes. Now if you have a few devices this is not a big deal. But if you have a couple hundred to a couple of thousand devices, this could be a real hassle.

Now you can take a ton of your time and review Class by Class and Device by Device until you finally finish. You will eventually get it all in a Zenpack……. Well lucky for you guys I created a Python Script that runs as the Zenoss user and create a Zenpack for you. All you have to do is pick a name for the ZenPack and optionally the Device Class you want to scan. The script will scan the Device Class that you specified ( or by default scan the entire /Device Class and its Sub Classes). It will then create the ZenPack with all the locally attached Device Templates. I am thinking of also adding the Events class as part of the next release of this script.

Update 1.0.1, I added the –unique option. If you decide to use this option, This Zenpack will only add, The Device Templates that are not already part of an existing ZenPack. I also added the –verbose option, so that you can see which Device Templates are being added or being dismissed.

You can download the script here
Download

Continue reading “HowTo backup all of your Zenoss Templates the easy way.” »

Feb 072010
 

In this HowTo, I will show you how you can get statistics off of the Netscaler without using SNMP. You might be asking why would I want to do that?? Well like many other devices that support SNMP, the Netscaler makes use of dynamic OID creation. For those of you that do not understand what I mean. Dynamic OID creation, is the way that Networking devices give OID’s to variables that are not static in the device itself.

Here are some common static variables/OID’s, amongst most devices out there.

  • CPU Utilization
  • Disk Utilization
  • Memory Utilization
  • TCP Statistics

Here are some common, non-static variables/OID’s..

  • A Load Balanced Virtual Server
  • Statistics about LUNS
  • Statistics about Services

Now you can get these statistics off of the SNMP based device. But if and when this device is rebooted, more then likely the OID has changed. Now you are stuck with the task, of finding the new OID. Since the Netscalers have a SOAP Based API, we can get those same statistics with out ever needing to know the OID.

Here I have attached a script that I wrote, using Python and Suds to connect to the Netscaler. This script works perfectly with Zenoss and its DataPoint structure. Download

Continue reading “HowTo monitor the Netscaler using Python and Soap instead of SNMP” »

Feb 012010
 

Recently I just started to use the Citrix Netscalers again ( Load Balancers ). Being the person that I am, I wanted a way to grab the information using the SOAP API.
Now Citrix has a ton of documentation for Perl/C/C# and Java ( None for Python ). SOAP client support has not been the best for Python, in my opinion.
I know you have soappy/ZSI, which I have had issues with consuming Broken WSDL files ( Having to fix the Broken WSDL file manually, SUCKS!).

Just 2 weeks ago, I encounterd SUDS. This module is by far, the best SOAP client for Python.
There documentation is simple and straight to the point, with a bunch of nice samples to get you on your way.

Install SUDS before proceeding further. You can get suds from here. https://fedorahosted.org/suds/
Connection to my netscaler was as simple as this…

Python 2.4.3 (#1, Sep  3 2009, 15:37:37)[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
on linux2Type "help", "copyright", "credits" or "license" for more information.
>>> from suds.client import Client
>>> url = "http://nsip/api/NSConfig.wsdl"
>>> from suds.xsd.doctor import *
>>> imp = Import('http://schemas.xmlsoap.org/soap/encoding/')
>>> imp.filter.add("urn:NSConfig")
>>> d = ImportDoctor(imp)
>>> client = Client(url, doctor=d, location="http://nsip/soap/")
>>> client.service.login(username="login", password="pass")(simpleResult){ rc = 0 message = "Done" }
>>>

Continue reading “How to get information from the Netscaler using Python and Suds.” »


Warning: fopen(/home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/lib/standard.txt) [function.fopen]: failed to open stream: No such file or directory in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 104

Warning: fread(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 105

Warning: fclose(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 106
.