Mar 5, 2010 12:25 AM
Zenoss Template Manager..
-
Like (0)
I just finished writing a script, that will allow you to add multiple datapoints using the command line. I know a few people were asking for an easy way to add datapoints. So here it is...
FYI, I will be adding more features in the next few days on http://linuxdynasty.org
http://www.linuxdynasty.org/howto-add-multiple-datapoints-to-zenoss-using-the-zenoss-api.html
I also added a doc in the community... docs/DOC-5795
Future updates will only be maintained on http://linuxdynasty.org
I was checking that out over at your site. That was really slick! I get the feeling that it is going to be really popular with users who are customizing their installations..
Thank you... I do appreciate the comment. I am going to ad more features real soon... Keep checking.. Oh and if you have any suggestions, please let me know.
Revision 1.0.3 is out... Its is a tad bit more flexible now. you have the ability to list your templates for a device or a organizer as well as listing of datasources and datapoints for devices.
http://www.linuxdynasty.org/howto-add-multiple-datapoints-to-zenoss-using-the-zenoss-api.html
Examples below...
python Zenoss_Template_Manager.py -d "qazenoss" --list="datapoints" -t "TESTER4LIFE2"
ifInDiscards /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifInDiscards
ifInErrors /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifInErrors
ifInNUcastPkts /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifInNUcastPkts
ifInOctets /zport/dmd/Devices/Server/Tomcat/qdevices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifInOctets
ifInUcastPkts /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifInUcastPkts
ifOutDiscards /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifOutDiscards
ifOutErrors /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifOutErrors
ifOutNUcastPkts /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifOutNUcastPkts
ifOutOctets /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifOutOctets
ifOutUcastPkts /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifOutUcastPkts
ifSpeed /zport/dmd/Devices/Server/Tomcat/devices/qazenoss/TESTER4LIFE2/datasources/WoW2/datapoints/ifSpeed
python Zenoss_Template_Manager.py -o "/Devices/Server/Tomcat" -l "datasources" -t "Tomcat Thread Pool"
Tomcat Current Thread Count /zport/dmd/Devices/Server/Tomcat/rrdTemplates/Tomcat%20Thread%20Pool/datasources/Tomcat%20Current%20Thread%20Count
Tomcat Current Threads Busy /zport/dmd/Devices/Server/Tomcat/rrdTemplates/Tomcat%20Thread%20Pool/datasources/Tomcat%20Current%20Threads%20Busy
python Zenoss_Template_Manager.py -o "/Devices/Server/Tomcat" -l "templates"
DigMonitor /zport/dmd/Devices/Server/rrdTemplates/DigMonitor
FtpMonitor /zport/dmd/Devices/rrdTemplates/FtpMonitor
Java /zport/dmd/Devices/rrdTemplates/Jav
python Zenoss_Template_Manager.py -o "/Devices/Server/Linux" -c '/opt/zenoss/libexec/snmp_branch.py -c public
-d localhost -p 161 -o 1.3.6.1.2.1.2.2.1 --ival="1 --label="ifIndex,ifDescr,ifType,ifMtu,ifSpeed,ifPhysAddress,ifAdminStatus,ifOperStatus,ifLastChange,ifInOctets,ifInUcastPkts,ifInNUcast
Pkts,InDiscards,ifInErrors,ifInUnknownProtos,ifOutOctets,ifOutUcastPkts,ifOutNUcastPkts,ifOutDiscards,ifOutErrors,ifOutQLen,ifSpecific"'
--template=TESTER4LIFE2 -p "ifSpeed,G" -p "ifInOctets,C" -p "ifInUcastPkts,C" -p "ifInNUcastPkts,C" -p "ifInDiscards,C" -p "ifInErrors,C" -p
"ifOutOctets,C" -p "ifOutUcastPkts,C" -p "ifOutNUcastPkts,C" -p "ifOutDiscards,C" -p "ifOutErrors,C" --dsource="WoW2" -V
Template TESTER4LIFE2 already existed
WoW2 DataSource already exists
Parser = Auto
Command /opt/zenoss/libexec/snmp_branch.py -c public -d localhost -p 161 -o 1.3.6.1.2.1.2.2.1 --ival="1" --label="ifIndex,ifDescr,ifType,ifMtu,ifSpeed,ifPhysAddress,ifAdminStatus,ifOperStatus,ifLastChange,ifInOctets,ifInUcastPkts,
ifInNUcastPkts,InDiscards,ifInErrors,ifInUnknownProtos,ifOutOctets,ifOutUcastPkts,ifOutNUcastPkts,ifOutDiscards,ifOutErrors,
ifOutQLen,ifSpecific" has been added to DataSource
ifSpeed DataPoint added and type = GAUGE
ifInOctets DataPoint added and type = COUNTER
ifInUcastPkts DataPoint added and type = COUNTER
ifInNUcastPkts DataPoint added and type = COUNTER
ifInDiscards DataPoint added and type = COUNTER
ifInErrors DataPoint added and type = COUNTER
ifOutOctets DataPoint added and type = COUNTER
ifOutUcastPkts DataPoint added and type = COUNTER
ifOutNUcastPkts DataPoint added and type = COUNTER
ifOutDiscards DataPoint added and type = COUNTER
ifOutErrors DataPoint added and type = COUNTER
python Zenoss_Template_Manager.py -d "zenoss.linuxdynasty" -t TESTER4LIFE2 -p "ifSpeed,G" -p "ifInOctets,C" -p "ifInUcastPkts,C" -p "ifInNUcastPkts,C" -p "ifInDiscards,C" -p "ifInErrors,C" -p "ifOutOctets,C" -p "ifOutUcastPkts,C" -p "ifOutNUcastPkts,C" -p "ifOutDiscards,C" -p "ifOutErrors,C" -s "WoW3" -V
Template TESTER4LIFE2 already exists at /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2
DataSource WoW3 already exists at /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
Parser = Auto
DataPoint ifSpeed of type GAUGE has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifInOctets of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifInUcastPkts of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifInNUcastPkts of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifInDiscards of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifInErrors of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifOutOctets of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifOutUcastPkts of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifOutNUcastPkts of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifOutDiscards of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
DataPoint ifOutErrors of type COUNTER has been added to DataSource /zport/dmd/Devices/Server/Tomcat/qa/devices/zenoss.linuxdynasty/TESTER4LIFE2/datasources/WoW3
Update 1.0.4, Now have the ability to create thresholds, bind templates to class or device, set severities on thresholds and
datasources, attach datapoints to thresholds.
Update 1.0.5 is out, Now have the ability to add multiple graphs with multiple datapoints.
http://www.linuxdynasty.org/howto-add-multiple-datapoints-to-zenoss-using-the-zenoss-api.html
Update 1.0.6, fixed a bug, that if you did not pass the -G option for graph the script would fail with..
Traceback (most recent call last):
File "./Zenoss_Template_Manager.py", line 345, in ?
if len(options.graphs) >=1:
TypeError: len() of unsized object
http://www.linuxdynasty.org/howto-add-multiple-datapoints-to-zenoss-using-the-zenoss-api.html
I also created a cool trick with sed so that you can add 100 datapoints in one shot with out haveing totype them all... (Idea came from Stephan 26)
check out the full post here..
http://www.linuxdynasty.org/forums/Scripting/scripting/ZenossTemplateManager
Hey everyone,
Does anyone have a copy of version 1.0.6? The linuxdynasty site appears to be down currently.
Thanks
Paul
My site is back up, though alot of the old links are dead. The article you needed is back up on the site at the same url.
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||