virt-uname

# virt-uname CentOS5x32
Guest            System name      
CentOS5x32       Linux centos5x32.home.annexia.org 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:20:55 EDT 2009 i686 
# virt-uname CentOS5x32 --csv
Guest,System name
CentOS5x32,Linux centos5x32.home.annexia.org 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:20:55 EDT 2009 i686

The query is done over an authenticated and encrypted SNMPv3 connection into the guest. This requires that the guest is running snmpd, but the end game here would be to have snmpd installed routinely, with a minimal config that only answers localhost connections which are properly encrypted with the key known only by the host and the guest.

Code here, and previous discussion.

Edit:

# virt-uptime CentOS5x32
Guest            Uptime
CentOS5x32       3 hours, 16:33.96
# virt-ping 
Guest            Status           
CentOS5x32       ok               
About these ads

4 Comments

Filed under Uncategorized

4 responses to “virt-uname

  1. I like your tools. I’ve put up the virt-preview repo on my Fedora 11 box and I think some of them are already in there, am I right?

    One question that has been bugging me though, is why you are using Perl for this? I am not out to start a programming language crusade / holy war / whatever, but as a lot of the other programs in the virt suite and a lot of new Fedora management tools seem to be written in Python, wouldn’t it make more sense to write your tools in Python too?

    Mind you, no offense meant: I do find the tools useful, I was just surprised to find they were written in Perl. My question is purely out of curiosity :-)

  2. rich

    I don’t particularly like either Python or Perl. They’re both slow, unsafe languages, so neither would be my first choice for implementing the tools.

    The particular dependency we have, however, is on the Perl library Sys::Guestfs::Lib which implements the OS detection in virt-inspector. That library is written in Perl because virt-v2v is written in Perl (which was the first choice for the author or virt-v2v).

  3. Ok, fair enough. Thanks for the update.

  4. Matt

    Actually, virt-v2v is in perl because Sys::Guestfs::Lib is in perl, which was because it was refactored from virt-inspector, which was in perl. I don’t mind perl (and actually quite like it), but it just sort of ‘happened that way’ in this case.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s