Subject: |
RE: Zenoss 4.2.5 zenbatchload |
Author: |
Michael Rogers |
Posted: |
2020-12-14 18:23 |
Davide,
Zenoss Core 4.2.5 should allow you to run zenbatchload with the `--sample_configs` flag to see samples of the batchload syntax. Here is the output when running the command on my 6.4.1 instance:
$ zenbatchload --sample_configs
#
# Example zenbatchloader file (Groups, Systems Locations, Devices, etc.)
#
# This file is formatted with one entry per line, like this:
#
# /Devices/device_class_name Python-expression
# hostname Python-expression
#
# For organizers (for example, 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:
#
# * loader arguments (use the --show_options flag to show these)
#
# * zProperties (from a device, use the 'Configuration Properties'
# menu item to see the available ones.)
#
# NOTE: new zProperties *cannot* be created through this file
#
# * cProperties (from a device, use the 'Custom Properties'
# menu item to see the available ones.)
#
# NOTE: new cProperties *cannot* be created through this file
#
# The Python-expression is used to create a dictionary of settings.
# device_settings = eval( 'dict(' + python-expression + ')' )
#
# Defining groups
/Groups/Admin
/Groups/Support
#Defining systems
/Systems/Production
/Systems/Staging
# Defining locations
/Locations/Canada address="Canada"
/Locations/Canada/Alberta address="Alberta, Canada"
/Locations/Canada/Alberta/Calgary address="Calgary, Alberta, Canada"
# If no organizer is specified at the beginning of the file,
# defaults to the /Devices/Discovered device class.
device0 comments="A simple device"
# All settings must be seperated by a comma.
device1 comments="A simple device", zSnmpCommunity='blue', zSnmpVer='v1'
# Notes for this file:
# * Oraganizer names *must* start with '/'
#
/Devices/Server/Linux zSnmpPort=1543
# Python strings can use either ' or " -- there's no difference.
# As a special case, it is also possible to specify the IP address
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...
linux_device2 zLinks="<a href='http://example.org'>Support site</a>", zTelnetEnable=True, zTelnetPromptTimeout=15.3
# A new organizer drops all previous settings, and allows
# for new ones to be used.
/Devices/Server/Windows zWinUser="administrator", zWinPassword='fred'
# Bind templates
windows_device1 zDeviceTemplates=[ 'Device', 'myTemplate' ], rackSlot=1
# Override the default from the organizer setting.
windows_device2 zWinUser="administrator", zWinPassword='thomas', setProdState=500, rackSlot=2, settingsDevice setManageIp='10.10.10.77', setLocation="123 Elm Street", setSystems=['/mySystems'], setPerformanceMonitor='remoteCollector1', setHWSerialNumber="abc123456789", setGroups=['/myGroup'], # Apply custom schema properties (c-properties) to a device
windows_device7 cDateTest='2010/02/28'
# If the device or device class contains a space, then it must be quoted (either ' or ")
"/Server/Windows/WMI/Active Directory/2008"
windows_device_3 setTitle="Windows AD Server 1", setHWTag="service-tag-ABCDEF", setPriority=2
# 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:
#
#/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
# The following are wrapper methods that specifically set properties on a device:
# setManageIp
# setPerformanceMonitor
# setTitle
# setHWTag
# setHWSerialNumber
# setProdState
# setPriority
# setGroups
# setSystems
There shouldn't be any difference in acceptable syntax between 4.2.5 and 6.4.1, but I would recommend running the command on your system to confirm.
------------------------------
Michael J. Rogers
Senior Instructor - Zenoss
Austin TX
------------------------------
Subject: |
RE: Zenoss 4.2.5 zenbatchload |
Author: |
Davide Mancosu |
Posted: |
2020-12-15 03:23 |
Thanks
Michael it works now.
Regards------------------------------
Davide Mancosu
system administartor
Tiscali Italia S.p.A.
Cagliari
------------------------------