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” »

 

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.” »

 

I’ve been using Swatch for quite a while now and I never invested the time to  create a quick startup script. Today, I decided to create one and it works just fine under Centos and Ubuntu Server. You can download it here..
swatch init script == Download

Continue reading “Swatch Startup Script” »

 

For those of you who visit linuxdynasty everyday, you might have notice some subtle changes in the authorization aspect fo the site. I had to enable captch images in the login, and posting parts of the site. Since for the past few weeks, spammers have been hitting the comments and forums section. I’m hoping this does not annoy everyone, but the spamming is starting to really annoy me.

 

It is official, I have begun development on the Web Server and Database for the Port Report Project and the Network Device Manager Project. I will be combining both scripts into a True Network Device Manager. My goal is to create an Open Source Network Device Manager that will give Admins and Engineers complete Insight/Access to their network. It does not matter if you want to know which switch your ESX host is directly connected to or if you want to manage all your Switches/Linux Hosts with this product. We have a few more ideas on what we want to do, but they are just ideas and I will not post them yet.

I will be using Python, Pexpect, PySnmp, SQLAlchemy, and Django for this project. I’m hoping to have an Alpha for users to test by late November or early December. If you are interested in this project, please give me ideas on what you would like to see in this Project. Currently we do not have an official name for the project.  If you have one, let me know as well. All ideas are welcome, as we are trying to make a complete enterprise product out of this project.

 

Here is another quick update for the Network Device Manager script.

Revision 0.23 10/14/2009

  • Fixed issue with sudo not working correctly
    Thanks to masweb21 for pointing that out.

 

Download

 

Today I was given a task to have my manager emailed once a day. If any of our Data Stores in ESX 3.5 are over 80% utilized. So I said to my self. What would be the easiest way to do this???? Well I’ve written two scripts in the past, that could help me accomplish that. The first script VMstoragePool.py will list all of the Data Stores in Vmware and its utilization. The 2nd script is check_datastore.py, and this script will return OK, WARNING, or CRITICAL, depending on the thresholds you set. So by effectively combining the 2 scripts I was able to get what I want. Example below…

python VMstoragePool.py -u "https://esxhostA" -a "login passwd" |grep "DataStore Name" |awk {'print $3'} |for line in `xargs`;do python check_datastore.py -u "https://esxhostA" -a "login passwd" -d $line -w 80 -c 90 -m "GB"|grep -P "WARNING|CRITICAL";done|mail user@domain.com
CRITICAL XythosVol2 57GB Avail 94% used |avail=57
WARNING XythosVol1 62GB Avail 87% used |avail=62
WARNING LinuxVol1 57GB Avail 88% used |avail=57
WARNING WinVol1 75GB Avail 84% used |avail=75
WARNING BBSCVOL1 122GB Avail 88% used |avail=122
CRITICAL NSSharedVOL1 46GB Avail 95% used |avail=46

 

So I can run this script in cron once a day and pipe the output to email him directly. Simple yet effective! On a side note, I fixed both chec_datastore.py and VMstoragePool.py to effectivly parse passwd’s that used characters like !@#$%^.

Both scripts can be downlaoded here..
check_datastore.py == Download

VMstoragePool.py == Download

 

We are please to announce the release of Network Device Manager 0.22. Release notes below..

Revision 0.22 10/02/2009

  • Threading has been implemented into the script. Drastic Speed increase!!
    It use to take about 18 minutes to run this script against 285 devices. It now just takes me 23 seconds.
  • Better error checking!

{quickdown:49}

To see how to use the tool above, please check this link http://www.linuxdynasty.org/howto-manage-your-networked-devices-using-python-and-pexpect.html

 

Here is another quick update for today. This time it is for ldNetDeviceManager.py.
Revision .21 10/01/2009

  • Can now save output to a file. using the –save option

{quickdown:49}

Continue reading “LD Network Device Manager update .21” »

 

Quick update today! User Christianha, pointed out to me that the port_report tool was not matching any MAC address he passed. The reason for this is because he was passing the MAC address in uppercase. As per his suggestion, I fixed line 348 so that before it returns the mac, it willl make the MAC lower case. Then I just realized something…. I reverted line 348 back to way it was and changed line 676 instead..

It was if nmac == cmac:
Now it is  re.search(nmac, cmac, re.IGNORECASE):

I felt this was the safer option..

Thank you Christianha for pointing the issues out..

LD Port Report == Download

© 2011 LinuxDynasty Suffusion theme by Sayontan Sinha

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
.