[zenoss@localhost root]$ zenbatchload --sample_configs
#
# Example zenbatchloader device file
#mrua:使用方法,运行zenbatchload 添加设备清单文件(可以是文本文件)
# This file is formatted with one entry per line, like this:
#
# /Devices/device_class_name Python-expression
# hostname Python-expression
#mura:格式定义部分。第一行定义批量的设备分类,也可以理解为同类型同属性的配置,后面跟随Python表达式,第二行定义需添加适合该类属性的设备清单,同样可以跟随Python表达式。
# For organizers (ie the /Devices path), the Python-expression
# is used to define defaults to be used for devices listed
# after the organizer. The defaults that can be specified are:
#mura:注意设备分类的根结构应该是/Devices然后再跟随后面的结构路径。
# * loader arguments (use the --show_options flag to show these)
# * zPropertie (from a device, use the More -> zProperties
# menu option to see the available ones.)
#mura:这是一段关于Python表达式的说明,可通过--show_options查看默认的添加参数应用。对于单台添加设备而言,在Python表达式中,可利用zPropertie的变量。zPropertie可参看设备管理中的zProperties。
# NOTE: new zProperties *cannot* be created through this file
#mura:注意,这里只能应用已有的zProperite,并不能够在这里新添zProperties。
# The Python-expression is used to create a dictionary of settings.
# device_settings = eval( 'dict(' + python-expression + ')' )
#mura:但Python表达式可以用于创建新的字典。
# If no organizer is specified at the beginning of the file,
# defaults to the /Devices/Discovered device class.
#mura:如果在第一行中,不指定设备分类的话,哪么设备将默认添加到Discovered结构中。
device0 comments="A simple device"
# All settings must be seperated by a comma.
#mura:在Python表达式中,多个参数必需要通过“,”分隔
device1 comments="A simple device", zSnmpCommunity='blue', zSnmpVer='v1'
# Notes for this file:
# * Oraganizer names *must* start with '/'
#mura:另外,组织结构名称必需以“/”开始
/Devices/Server/Linux zSnmpPort=1543
# Python strings can use either ' or " -- there's no difference.
#mura:Python字符串可以使用引号锁定。
# As a special case, it is also possible to specify the IP address
#mura:特殊情况下,也可以指定设备的管理IP(监控访问IP),在这里mura建议大家写好setManagerIp。否则,设备将根据域名记录找寻设备。
linux_device1 setManageIp='10.10.10.77', zSnmpCommunity='blue', zSnmpVer="v2c"
# A '' at the end of the line allows you to place more
# expressions on a new line. Don't forget the comma...
#mura:如果一条Python表达式过长,允许回车记录,表达式的结尾时不可使用逗号。
linux_device2 zLinks="Support site", zTelnetEnable=True, zTelnetPromptTimeout=15.3
# A new organizer drops all previous settings, and allows
# for new ones to be used. Settings do not span files.
#mura:之前已经提及,在设备分类行中,可以将同属性的Python表达式一并写入。
/Devices/Server/Windows zWinUser="administrator", zWinPassword='fred'
# Bind templates
#mura:绑定模板的方法。
windows_device1 zDeviceTemplates=[ 'Device', 'myTemplate' ]
# Override the default from the organizer setting.
#mura:定义远程访问帐号方法。
windows_device2 zWinUser="administrator", zWinPassword='thomas'
# Apply other settings to the device
#mura:下面是一条设备添加设置的用法。
settingsDevice setManageIp='10.10.10.77', setLocation="123 Elm Street", setSystems='/mySystems', setPerformanceMonitor='remoteCollector1', setHWSerialNumber="abc123456789", setGroups='/myGroup', setHWProduct=('myproductName','manufacturer'), setOSProduct=('OS Name','manufacturer')
# If the device or device class contains a space, then it must be quoted (either ' or ")
#mura:如果设备分类中包含空格,必需使用引号锁定。
"/Server/Windows/WMI/Active Directory/2008"
# Now, what if we have a device that isn't really a device, and requires
# a special loader?
# The 'loader' setting requires a registered utility, and 'loader_arg_keys' is
# a list from which any other settings will be passed into the loader callable.
#
# Here is a commmented-out example of how a VMware endpoint might be added:
#mrua:如果是一台虚拟设备,并且要求指定宿主机的话,可以通过loader_arg_keys的方式传递参数。
#/Devices/VMware loader='vmware', loader_arg_keys=['host', 'username', 'password', 'useSsl', 'id']
#esxwin2 id='esxwin2', host='esxwin2.zenoss.loc', username='testuser', password='password', useSsl=True