thinking sysadmin

qstat -u aleonard -s z

Archive for the ‘python’ tag

Filling in the Missing Parts of NetApp’s API

leave a comment

Late last year, NetApp released long-overdue Python and Ruby support in their SDK, officially known as the NetApp Manageability SDK. The SDK download is – oddly and unfortunately – still buried behind a paywall, and you have to submit a web form about how you plan to use it to get access to the download; otherwise it’s available to all.

But perhaps there’s good reason for hiding the download away: There are still large gaps in the API. For instance, say you want to change the security mode of a qtree? You’re out of luck. (Makes one wonder how NetApp implements this functionality in OnCommand System Manager – are they eating their own dogfood?)

That said, if you’re willing to venture off the beaten (and supported) path, you can use the undocumented system-cli API call. Here’s how I’m using it in a Python wrapper I’m working on that makes the SDK feel a little bit less like handling thinly-varnished XML:
Read the rest of this entry »

Written by Andy

February 27th, 2012 at 8:47 pm

Posted in storage

Tagged with , , ,

Git-driven BIND (plus Fabric)

leave a comment

Step 0. Store your DNS configuration in Git. If you aren’t using some sort of version control system for your zone files and other BIND configuration, you ought to be. May I recommend Git? Put your entire configuration directory in there, but do read the “Downsides” section below for some important security considerations.

Step 1. Create a bare Git repository on your DNS server. Using Fabric, you’d do it something like this:

def config_git():

    # Create bare git repo for direct DNS data pushes:
    sudo('/bin/mkdir /srv/bind.git')
    sudo('/bin/chown ubuntu:ubuntu /srv/bind.git')
    with cd('/srv/bind.git'):
        run('/usr/bin/git init --bare .')
    git_post_receive()

(The above assumes an Ubuntu system, where the “ubuntu” user has sudo privileges, such as on EC2; adjust to your environment as needed.)
Read the rest of this entry »

Written by Andy

December 28th, 2011 at 7:46 pm

Posted in dns

Tagged with , , , , ,

Two Useful Tools: ack and autojump

2 comments

A recent answer to a question on Quora – What are some time-saving tips that every Linux user should know? – suggested two tools I’ve found very useful: ack and autojump.
Read the rest of this entry »

Written by Andy

January 8th, 2011 at 3:51 pm

Posted in Applications

Tagged with , , , ,