[zenoss-zenpacks] ESX Zenpack - Modeling not gathering FileSystem info

slmiller scott.l.miller at gmail.com
Mon Jun 30 11:24:28 EDT 2008


Hello,

I've installed the ESX Zenpack, but I'm unable to get any vfs filesystem information to load when "modeling" an ESX device.  I've attempted to read and make use of various posts within the zenoss forums, but nothing has helped yet.

Let me attempt to explain what I've done.  I have SNMP working on the ESX server and can snmpwalk that server's information from the zenoss server.  I have an ssh user, admin, that the zenoss account can ssh into the ESX server without needing a password (ssh key exchange), that user has been granted sudo for /usr/sbin/vfs.  I am able to directly call the (slightly modified -> added sudo to the command) vmware-esx.sh script; examples:

Code:

[zenoss at vr-mgmt2 bin]$ $ZENHOME/Products/VMwareEsx/libexec/vmware-esx.sh 10.1.9.70 public /vmfs/volumes/DriveArray1
DISK OK | usedBlocks=812826624 availBlocks=64307200 totalBlocks=877133824
[zenoss at vr-mgmt2 bin]$ $ZENHOME/Products/VMwareEsx/libexec/vmware-esx.sh 10.1.9.70 public /vmfs/volumes/storage1
DISK OK | usedBlocks=43841536 availBlocks=240584704 totalBlocks=284426240
[zenoss at vr-mgmt2 bin]$ $ZENHOME/Products/VMwareEsx/libexec/vmware-esx.sh 10.1.9.70 public /
DISK OK | usedBlocks=2586392 availBlocks=2194092 totalBlocks=5036316



However, and I realize the above has nothing to do with the modeling itself,  attempting to model the ESX device results in no filesystem information being loaded into Zenoss.  I've gone so far as to modify the modeler python code to print log messages into a file, but the file is never created.  Modified code:

Code:

import re

from CollectorPlugin import CommandPlugin

class VmwareEsxDf(CommandPlugin):
    """
    Run vdf -P to model filesystem information. Should work on all ESX servers.
    """
    maptype = "FilesystemMap"
    command = 'sudo /usr/sbin/vdf -P'
    compname = "os"
    relname = "filesystems"
    modname = "Products.ZenModel.FileSystem"


    def process(self, device, results, log):
        mylog=open('/tmp/mylog.txt', 'a')
        mylog.write("got here\n")
        log.info('Collecting filesystems for device %s\n' % device.id)
        mystr = "Collecting filesystems for device %s\n" % device.id
        mylog.write(mystr)
        skipfsnames = getattr(device, 'zFileSystemMapIgnoreNames', None)
        rm = self.relMap()
        rlines = results.split("\n")
        bline = ""
        for line in rlines:
            if line.startswith("Filesystem"): continue
            mystr = "line: %s\n" % line
            mylog.write(mystr)
            om = self.objectMap()
            spline = line.split()
            if len(spline) == 1:
                bline = spline[0]
                continue
            if bline:
                spline.insert(0,bline)
                bline = None
            if len(spline) != 6: continue
            (om.storageDevice, tblocks, u, a, p, om.mount) = spline
            if skipfsnames and re.search(skipfsnames,om.mount): continue
            om.totalBlocks = long(tblocks)
            mystr = "om.totalBlocks is %d\n" % om.totalBlocks
            mylog.write(mystr)
            om.blockSize = 1024
            om.id = self.prepId(om.mount)
            mystr = "om.id is %s\n" % om.id
            mylog.write(mystr)
            rm.append(om)
        mylog.close
        return rm



Since the file is never even created, I believe this code is never being called from the modeling process.  I've verified that the VmwareEsxDf is in the modeling list, and see this in the html device modeling output:

Code:
2008-06-27 15:49:56	INFO 	zen.ZenModeler	plugins: VmwareEsxDf



but I see nothing indicating that is actually called, and again, since the file doesn't exist, I have to assume it is not being called.

Later, in that same output I see these lines:

Code:

2008-06-27 15:50:01	WARNING 	zen.ZenModeler	client dev-vmware1 not found in active clients
2008-06-27 15:50:01	WARNING 	zen.ZenModeler	client dev-vmware1 not found in active clients
2008-06-27 15:50:01	WARNING 	zen.ZenModeler	client dev-vmware1 not found in active clients
2008-06-27 15:50:01	WARNING 	zen.ZenModeler	client dev-vmware1 not found in active clients
2008-06-27 15:50:01	WARNING 	zen.ZenModeler	client dev-vmware1 not found in active clients



But I haven't been able to figure out what the root cause(s) for these messages is(are).

I am new to python, but not to programming, so syntax errors are certainly a possibility, but I can't figure out how to check if the file is valid python.  Neither python, nor zendmd are able to do the import of the CommandPlugin. A .pyc file is created, but I don't know if that is a valid indication of valid python code.

Any help you can give would be greatly appreciated,

-Scott L. Miller




-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=21974#21974

-------------------- m2f --------------------





More information about the zenoss-zenpacks mailing list